mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-09-20 21:02:58 +00:00
fix newPage and newColumn
This commit is contained in:
@@ -235,13 +235,21 @@ const makeHeader = (level)=>(view)=>{
|
||||
|
||||
const newColumn = (view)=>{
|
||||
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;
|
||||
};
|
||||
|
||||
const newPage = (view)=>{
|
||||
const newPage = (view) => {
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user