Skip to content

Commit

Permalink
Editor scroll position jumps up when returning to editor (#203013)
Browse files Browse the repository at this point in the history
Fixes #202811
  • Loading branch information
alexr00 authored Jan 23, 2024
1 parent 800e60a commit c1cbd49
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { ICellRange } from 'vs/workbench/contrib/notebook/common/notebookRange';
import { commentThreadStateBackgroundColorVar, commentThreadStateColorVar, getCommentThreadStateBorderColor } from 'vs/workbench/contrib/comments/browser/commentColors';
import { peekViewBorder } from 'vs/editor/contrib/peekView/browser/peekView';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { StableEditorScrollState } from 'vs/editor/browser/stableEditorScroll';

function getCommentThreadWidgetStateColor(thread: languages.CommentThreadState | undefined, theme: IColorTheme): Color | undefined {
return getCommentThreadStateBorderColor(thread, theme) ?? theme.getColor(peekViewBorder);
Expand Down Expand Up @@ -453,7 +454,9 @@ export class ReviewZoneWidget extends ZoneWidget implements ICommentThreadWidget
this._commentThreadWidget.focusCommentEditor();
}

const capture = StableEditorScrollState.capture(this.editor);
this._relayout(computedLinesNumber);
capture.restore(this.editor);
}
}

Expand Down

0 comments on commit c1cbd49

Please sign in to comment.