reduce redundant relayout in notebook diff editor

This commit is contained in:
rebornix 2020-10-05 17:16:03 -07:00
parent 1ccad27e9b
commit 20565ce53d

View file

@ -746,7 +746,7 @@ export class DeletedCell extends AbstractCellRenderer {
this._layoutInfo.editorHeight = editorHeight;
this._register(this._editor.onDidContentSizeChange((e) => {
if (e.contentHeightChanged) {
if (e.contentHeightChanged && this._layoutInfo.editorHeight !== e.contentHeight) {
this._layoutInfo.editorHeight = e.contentHeight;
this.layout({ editorHeight: true });
}
@ -836,7 +836,7 @@ export class InsertCell extends AbstractCellRenderer {
this._layoutInfo.editorHeight = editorHeight;
this._register(this._editor.onDidContentSizeChange((e) => {
if (e.contentHeightChanged) {
if (e.contentHeightChanged && this._layoutInfo.editorHeight !== e.contentHeight) {
this._layoutInfo.editorHeight = e.contentHeight;
this.layout({ editorHeight: true });
}
@ -929,7 +929,7 @@ export class ModifiedCell extends AbstractCellRenderer {
this._editorContainer.style.height = `${editorHeight}px`;
this._register(this._editor.onDidContentSizeChange((e) => {
if (e.contentHeightChanged) {
if (e.contentHeightChanged && this._layoutInfo.editorHeight !== e.contentHeight) {
this._layoutInfo.editorHeight = e.contentHeight;
this.layout({ editorHeight: true });
}