Skip to content

Commit

Permalink
feat: center cursor in line
Browse files Browse the repository at this point in the history
close #183
  • Loading branch information
Vinzent03 committed Aug 12, 2024
1 parent 1f733dc commit e941beb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,13 @@ export default class AdvancedURI extends Plugin {
line: line,
ch: column ?? maxColumn,
});
view.editor.scrollIntoView(
{
from: { line: line, ch: column ?? maxColumn },
to: { line: line, ch: column ?? maxColumn },
},
true
);

await new Promise((resolve) => setTimeout(resolve, 10));

Expand Down

0 comments on commit e941beb

Please sign in to comment.