Skip to content

Commit

Permalink
"Show Next Change" doesn't show the right change (#180951)
Browse files Browse the repository at this point in the history
Fixes #180744
  • Loading branch information
alexr00 authored Apr 26, 2023
1 parent 0198f59 commit 9d2090b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ export class DirtyDiffController extends Disposable implements DirtyDiffContribu
}

let index: number;
if (this.editor.hasModel() && (typeof lineNumber === 'number')) {
if (this.editor.hasModel() && (typeof lineNumber === 'number' || !this.widget.provider)) {
index = this.model.findNextClosestChange(typeof lineNumber === 'number' ? lineNumber : this.editor.getPosition().lineNumber, true, this.widget.provider);
} else {
const providerChanges: number[] = this.model.mapChanges.get(this.widget.provider) ?? this.model.mapChanges.values().next().value;
Expand Down Expand Up @@ -1466,7 +1466,7 @@ export class DirtyDiffModel extends Disposable {
const possibleChangesLength = possibleChanges.length;

if (inclusive) {
if ((getModifiedEndLineNumber(change.change) >= lineNumber) && (change.change.modifiedStartLineNumber <= lineNumber)) {
if (getModifiedEndLineNumber(change.change) >= lineNumber) {
if (preferredProvider && change.label !== preferredProvider) {
possibleChanges.push(i);
} else {
Expand Down

0 comments on commit 9d2090b

Please sign in to comment.