mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
Fixes #20578: Maintain scroll state when disabling code lens
This commit is contained in:
@@ -171,11 +171,13 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
|
||||
this._localToDispose.push({
|
||||
dispose: () => {
|
||||
if (this._editor.getModel()) {
|
||||
const scrollState = StableEditorScrollState.capture(this._editor);
|
||||
this._editor.changeDecorations((changeAccessor) => {
|
||||
this._editor.changeViewZones((accessor) => {
|
||||
this._disposeAllLenses(changeAccessor, accessor);
|
||||
});
|
||||
});
|
||||
scrollState.restore(this._editor);
|
||||
} else {
|
||||
// No accessors available
|
||||
this._disposeAllLenses(null, null);
|
||||
|
||||
Reference in New Issue
Block a user