Update the height only after processing all the change events (#42317)

This commit is contained in:
Alex Dima
2018-04-25 21:55:57 +02:00
parent 9cbc162947
commit b58327d483
2 changed files with 1 additions and 3 deletions
@@ -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
@@ -231,6 +231,7 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel
}
}
this.lines.acceptVersionId(versionId);
this.viewLayout.onHeightMaybeChanged();
if (!hadOtherModelChange && hadModelLineChangeThatChangedLineMapping) {
eventsCollector.emit(new viewEvents.ViewLineMappingChangedEvent());