fix newPage and newColumn

This commit is contained in:
Víctor Losada Hernández
2026-09-13 15:43:59 +02:00
parent 39c60f42fd
commit 13b13b03e0
@@ -235,13 +235,21 @@ const makeHeader = (level)=>(view)=>{
const newColumn = (view)=>{ const newColumn = (view)=>{
const { from, to } = view.state.selection.main; const { from, to } = view.state.selection.main;
view.dispatch({ changes: { from, to, insert: '\n\\column\n\n' } }); const insert = '\n\\column\n\n' ;
view.dispatch({
changes: { from, to, insert },
selection: { anchor: from + insert.length }
});
return true; return true;
}; };
const newPage = (view) => { const newPage = (view) => {
const { from, to } = view.state.selection.main; const { from, to } = view.state.selection.main;
view.dispatch({ changes: { from, to, insert: '\n\\page\n\n' } }); const insert = '\n\\page\n\n';
view.dispatch({
changes: { from, to, insert },
selection: { anchor: from + insert.length }
});
return true; return true;
}; };