mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
fix #133928
This commit is contained in:
parent
e38fbdae27
commit
c775da5f0f
|
@ -408,11 +408,14 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
|
|||
const diffResult = await this.notebookEditorWorkerService.computeDiff(this._model.original.resource, this._model.modified.resource);
|
||||
NotebookTextDiffEditor.prettyChanges(this._model, diffResult.cellsDiff);
|
||||
const { viewModels, firstChangeIndex } = NotebookTextDiffEditor.computeDiff(this.instantiationService, this.configurationService, this._model, this._eventDispatcher!, diffResult);
|
||||
const isSame = this._isViewModelTheSame(viewModels);
|
||||
|
||||
this._originalWebview?.removeInsets([...this._originalWebview?.insetMapping.keys()]);
|
||||
this._modifiedWebview?.removeInsets([...this._modifiedWebview?.insetMapping.keys()]);
|
||||
if (!isSame) {
|
||||
this._originalWebview?.removeInsets([...this._originalWebview?.insetMapping.keys()]);
|
||||
this._modifiedWebview?.removeInsets([...this._modifiedWebview?.insetMapping.keys()]);
|
||||
this._setViewModel(viewModels);
|
||||
}
|
||||
|
||||
this._setViewModel(viewModels);
|
||||
// this._diffElementViewModels = viewModels;
|
||||
// this._list.splice(0, this._list.length, this._diffElementViewModels);
|
||||
|
||||
|
@ -423,7 +426,7 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
|
|||
}
|
||||
}
|
||||
|
||||
private _setViewModel(viewModels: DiffElementViewModelBase[]) {
|
||||
private _isViewModelTheSame(viewModels: DiffElementViewModelBase[]) {
|
||||
let isSame = true;
|
||||
if (this._diffElementViewModels.length === viewModels.length) {
|
||||
for (let i = 0; i < viewModels.length; i++) {
|
||||
|
@ -440,13 +443,12 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
|
|||
isSame = false;
|
||||
}
|
||||
|
||||
if (isSame) {
|
||||
return;
|
||||
}
|
||||
return isSame;
|
||||
}
|
||||
|
||||
private _setViewModel(viewModels: DiffElementViewModelBase[]) {
|
||||
this._diffElementViewModels = viewModels;
|
||||
this._list.splice(0, this._list.length, this._diffElementViewModels);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue