Skip to content

Commit 9e6bd42

Browse files
authored
Account for modified content in cells (microsoft#226894)
1 parent 652478d commit 9e6bd42

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,12 +441,15 @@ function createDiffViewModels(instantiationService: IInstantiationService, confi
441441
);
442442
}
443443
case 'unchanged': {
444+
const originalCell = originalModel.cells[diff.originalCellIndex];
445+
const modifiedCell = modifiedModel.cells[diff.modifiedCellIndex];
446+
const type = (originalCell.textModel?.getValue() !== modifiedCell.textModel?.getValue()) ? 'modified' : 'unchanged';
444447
return new SideBySideDiffElementViewModel(
445448
model.modified.notebook,
446449
model.original.notebook,
447-
originalModel.cells[diff.originalCellIndex],
448-
modifiedModel.cells[diff.modifiedCellIndex],
449-
'unchanged',
450+
originalCell,
451+
modifiedCell,
452+
type,
450453
eventDispatcher,
451454
initData,
452455
notebookService

0 commit comments

Comments
 (0)