Support scrollIntoView in insertAtCursor syscall
parent
ac18443b53
commit
2e96155a05
|
@ -250,7 +250,7 @@ export function editorSyscalls(client: Client): SysCallMapping {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
"editor.insertAtCursor": (_ctx, text: string) => {
|
"editor.insertAtCursor": (_ctx, text: string, scrollIntoView = false) => {
|
||||||
const editorView = client.editorView;
|
const editorView = client.editorView;
|
||||||
const from = editorView.state.selection.main.from;
|
const from = editorView.state.selection.main.from;
|
||||||
editorView.dispatch({
|
editorView.dispatch({
|
||||||
|
@ -261,6 +261,7 @@ export function editorSyscalls(client: Client): SysCallMapping {
|
||||||
selection: {
|
selection: {
|
||||||
anchor: from + text.length,
|
anchor: from + text.length,
|
||||||
},
|
},
|
||||||
|
scrollIntoView,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
"editor.dispatch": (_ctx, change: Transaction) => {
|
"editor.dispatch": (_ctx, change: Transaction) => {
|
||||||
|
|
Loading…
Reference in New Issue