Skip to content

Commit

Permalink
always scroll to top when switching files
Browse files Browse the repository at this point in the history
  • Loading branch information
b-fein committed Oct 16, 2023
1 parent 8425924 commit 798170e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ export class CodeEditorAceComponent implements AfterViewInit, OnChanges, OnDestr
this.editor.setMode(this.editorMode);
this.editor.getEditor().resize();
this.editor.getEditor().focus();
// always scroll to the top, otherwise inline annotations might be placed incorrectly
this.editor.getEditor().getSession().setScrollTop(0);
// Reset the undo stack after file change, otherwise the user can undo back to the old file
this.editor.getEditor().getSession().setUndoManager(new UndoManager());
this.displayAnnotations();
Expand Down

0 comments on commit 798170e

Please sign in to comment.