Merge VS Code 1.23.1 (#1520)

This commit is contained in:
Matt Irvine
2018-06-05 11:24:51 -07:00
committed by GitHub
parent e3baf5c443
commit 0c58f09e59
3651 changed files with 74249 additions and 48599 deletions

View File

@@ -19,6 +19,7 @@ import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOption
import { CodeLens, CodeLensHelper } from 'vs/editor/contrib/codelens/codelensWidget';
import { IModelDecorationsChangeAccessor } from 'vs/editor/common/model';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { StableEditorScrollState } from 'vs/editor/browser/core/editorState';
export class CodeLensContribution implements editorCommon.IEditorContribution {
@@ -170,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);
@@ -218,8 +221,8 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
}
}
const centeredRange = this._editor.getCenteredRangeInViewport();
const shouldRestoreCenteredRange = centeredRange && (groups.length !== this._lenses.length && this._editor.getScrollTop() !== 0);
const scrollState = StableEditorScrollState.capture(this._editor);
this._editor.changeDecorations((changeAccessor) => {
this._editor.changeViewZones((accessor) => {
@@ -259,9 +262,8 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
helper.commit(changeAccessor);
});
});
if (shouldRestoreCenteredRange) {
this._editor.revealRangeInCenter(centeredRange, editorCommon.ScrollType.Immediate);
}
scrollState.restore(this._editor);
}
private _onViewportChanged(): void {