mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-09-20 16:42:58 +00:00
fix newPage and newColumn
This commit is contained in:
@@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user