Skip to content

Commit 8a625dc

Browse files
authored
Merge pull request microsoft#226567 from microsoft/don/fixNavigationInNbDiff
Ignore placeholders when navigating nb diff items
2 parents e81acea + 3966113 commit 8a625dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
660660
const currentViewModels = this.notebookDiffViewModel.items;
661661
while (prevChangeIndex >= 0) {
662662
const vm = currentViewModels[prevChangeIndex];
663-
if (vm.type !== 'unchanged') {
663+
if (vm.type !== 'unchanged' && vm.type !== 'placeholder') {
664664
break;
665665
}
666666

@@ -672,7 +672,7 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
672672
this._list.reveal(prevChangeIndex);
673673
} else {
674674
// go to the last one
675-
const index = findLastIdx(currentViewModels, vm => vm.type !== 'unchanged');
675+
const index = findLastIdx(currentViewModels, vm => vm.type !== 'unchanged' && vm.type !== 'placeholder');
676676
if (index >= 0) {
677677
this._list.setFocus([index]);
678678
this._list.reveal(index);
@@ -695,7 +695,7 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
695695
const currentViewModels = this.notebookDiffViewModel.items;
696696
while (nextChangeIndex < currentViewModels.length) {
697697
const vm = currentViewModels[nextChangeIndex];
698-
if (vm.type !== 'unchanged') {
698+
if (vm.type !== 'unchanged' && vm.type !== 'placeholder') {
699699
break;
700700
}
701701

@@ -707,7 +707,7 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
707707
this._list.reveal(nextChangeIndex);
708708
} else {
709709
// go to the first one
710-
const index = currentViewModels.findIndex(vm => vm.type !== 'unchanged');
710+
const index = currentViewModels.findIndex(vm => vm.type !== 'unchanged' && vm.type !== 'placeholder');
711711
if (index >= 0) {
712712
this._list.setFocus([index]);
713713
this._list.reveal(index);

0 commit comments

Comments
 (0)