Skip to content

Commit

Permalink
Merge pull request mauricedb#11 from DaniGuardiola/patch-1
Browse files Browse the repository at this point in the history
Scroll on new lines
  • Loading branch information
mauricedb authored Oct 17, 2020
2 parents d65fb83 + ca71e7c commit 31bc7da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/instruction-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ const typeTextIntoActiveTextEditor = async (
editBuilder.insert(editor.selection.active, char!);
if (char === '\n') {
pos = new Position(pos.line + 1, pos.character);
// scroll to last line
const lastLine = editor.document.lineCount - 1;
const lastLineRange = editor.document.lineAt(lastLine).range;
editor.revealRange(lastLineRange);
} else {
pos = new Position(pos.line, pos.character + 1);
}
Expand Down

0 comments on commit 31bc7da

Please sign in to comment.