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

@@ -11,7 +11,7 @@ import { LinesLayout } from 'vs/editor/common/viewLayout/linesLayout';
import { IViewLayout, IViewWhitespaceViewportData, Viewport } from 'vs/editor/common/viewModel/viewModel';
import { IPartialViewLinesViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData';
import { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer';
import Event from 'vs/base/common/event';
import { Event } from 'vs/base/common/event';
import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions';
const SMOOTH_SCROLLING_TIME = 125;
@@ -75,15 +75,12 @@ export class ViewLayout extends Disposable implements IViewLayout {
}
public onFlushed(lineCount: number): void {
this._linesLayout.onFlushed(lineCount);
this._updateHeight();
}
public onLinesDeleted(fromLineNumber: number, toLineNumber: number): void {
this._linesLayout.onLinesDeleted(fromLineNumber, toLineNumber);
this._updateHeight();
}
public onLinesInserted(fromLineNumber: number, toLineNumber: number): void {
this._linesLayout.onLinesInserted(fromLineNumber, toLineNumber);
this._updateHeight();
}
// ---- end view event handlers
@@ -163,7 +160,7 @@ export class ViewLayout extends Disposable implements IViewLayout {
// ---- view state
public saveState(): editorCommon.IViewState {
public saveState(): { scrollTop: number; scrollTopWithoutViewZones: number; scrollLeft: number; } {
const currentScrollPosition = this.scrollable.getFutureScrollPosition();
let scrollTop = currentScrollPosition.scrollTop;
let firstLineNumberInViewport = this._linesLayout.getLineNumberAtOrAfterVerticalOffset(scrollTop);
@@ -175,17 +172,6 @@ export class ViewLayout extends Disposable implements IViewLayout {
};
}
public reduceRestoreState(state: editorCommon.IViewState): { scrollLeft: number; scrollTop: number; } {
let restoreScrollTop = state.scrollTop;
if (typeof state.scrollTopWithoutViewZones === 'number' && !this._linesLayout.hasWhitespace()) {
restoreScrollTop = state.scrollTopWithoutViewZones;
}
return {
scrollLeft: state.scrollLeft,
scrollTop: restoreScrollTop
};
}
// ---- IVerticalLayoutProvider
public addWhitespace(afterLineNumber: number, ordinal: number, height: number): number {