diff --git a/src/utility.ts b/src/utility.ts index 9901e70..20456e2 100644 --- a/src/utility.ts +++ b/src/utility.ts @@ -48,7 +48,6 @@ export function goAndScrollToLine(editor: Editor, line: number) { // Also scroll to the heading to ensure its contents are visible const position = editor.getCursor(); - const range = editor.wordAt(position); - if(!range) return; + var range = editor.wordAt(position) ?? { from: position, to: position }; editor.scrollIntoView(range, true); } \ No newline at end of file