mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 10:38:31 -05:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user