From 2e96155a0594149965ec96dc2010c333c5dfe069 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Thu, 6 Feb 2025 08:37:34 +0100 Subject: [PATCH] Support scrollIntoView in insertAtCursor syscall --- web/syscalls/editor.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/syscalls/editor.ts b/web/syscalls/editor.ts index 818d6f8d..fa852af5 100644 --- a/web/syscalls/editor.ts +++ b/web/syscalls/editor.ts @@ -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 from = editorView.state.selection.main.from; editorView.dispatch({ @@ -261,6 +261,7 @@ export function editorSyscalls(client: Client): SysCallMapping { selection: { anchor: from + text.length, }, + scrollIntoView, }); }, "editor.dispatch": (_ctx, change: Transaction) => {