Skip to content

Fix #215925 #219321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2025
Merged

Fix #215925 #219321

merged 1 commit into from
Jun 16, 2025

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The Diff Editor "Next Change" action does not loop if there is a difference in the new line at the end of the files
5 participants