Skip to content

Conversation

@charles7668
Copy link
Contributor

fix #215925
Code_-_OSS_s70VAheLkA

Comment on lines 588 to 591
diff = diffs.find(
d => d.lineRangeMapping.modified.startLineNumber > curLineNumber &&
d.lineRangeMapping.modified.endLineNumberExclusive !== d.lineRangeMapping.modified.startLineNumber
) ?? diffs[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const modifiedLineCount = this._editors.modified.getModel()!.getLineCount();
if (modifiedLineCount === curLineNumber)
  diff = diffs[0];
else
  diff = diffs.find(d => d.lineRangeMapping.modified.startLineNumber > curLineNumber) ?? diffs[0];

I don't know if this will be better.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const modifiedLineCount = this._editors.modified.getModel()!.getLineCount();
if (modifiedLineCount === curLineNumber)
  diff = diffs[0];
else
  diff = diffs.find(d => d.lineRangeMapping.modified.startLineNumber > curLineNumber) ?? diffs[0];

I don't know if this will be better.

This seems to be a better solution. I have updated it.

This solution also solves the following issue

@tisilent
Copy link
Contributor

tisilent commented Jul 1, 2024

2
This scene,
When clicking next on the first line, it will always be in the first line.

@hediet hediet added this to the July 2024 milestone Jul 1, 2024
@hediet hediet modified the milestones: July 2024, August 2024 Jul 25, 2024
@hediet hediet modified the milestones: August 2024, September 2024 Aug 29, 2024
@hediet hediet modified the milestones: September 2024, October 2024 Sep 26, 2024
@hediet hediet modified the milestones: October 2024, November 2024 Oct 24, 2024
@hediet hediet modified the milestones: November 2024, January 2025 Dec 5, 2024
@hediet hediet modified the milestones: February 2025, March 2025 Feb 25, 2025
@hediet hediet modified the milestones: March 2025, April 2025 Mar 24, 2025
@hediet hediet modified the milestones: April 2025, May 2025 Apr 11, 2025
@hediet hediet modified the milestones: May 2025, June 2025 Jun 4, 2025
@hediet hediet enabled auto-merge (squash) June 6, 2025 11:04
@hediet hediet merged commit 3fb7f79 into microsoft:main Jun 16, 2025
7 checks passed
Subham-KRLX pushed a commit to Subham-KRLX/vscode that referenced this pull request Jun 17, 2025
Fix diff-view next/previous change loop (microsoft#215925)
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jul 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

5 participants