Editor scroll position jumps up when returning to editor (#203013)

Fixes #202811
This commit is contained in:
Alex Ross 2024-01-23 09:56:18 +01:00 committed by GitHub
parent 800e60abdf
commit c1cbd49099
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
@ -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);
}
}