Skip to content

Commit

Permalink
Scroll the view in all cases (fixes #5)
Browse files Browse the repository at this point in the history
  • Loading branch information
oin committed Dec 14, 2023
1 parent 497ecc2 commit 106c187
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 106c187

Please sign in to comment.