Skip to content

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

Closed
@hb20007

Description

@hb20007

Does this issue occur when all extensions are disabled? Yes

I am able to reproduce this issue on Windows with the latest build as well as on the Insiders Build on the web using https://insiders.vscode.dev/.

Steps to Reproduce

  1. Create 2 files to diff. One file should end with a new line and the other shouldn't.

Example:

file1.txt

This is the 1st sentence.

This is the second one.

This is number 3.

file2.txt

This is the first sentence.

This is the second one.

This is number 3.
  1. Use the "Next Change" action to cycle through the changes. Notice how it does not loop back to the beginning after reaching the last difference between the files, which is the end of file new line.

More Info

The "Previous Change" action works correctly and loops to the last difference when at the first difference. Also, the "Next Change" looping back to the first difference works correctly if the last difference is not a new line.

Why does it matter?

It might seem like a minor issue, but I need to diff large files where often one of the files is missing the new line at the end. If I use "Previous Change" at the beginning of the files, I am taken to the last difference at the end of the files, and I cannot use "Next Change" to go back to the start.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugdiff-editorDiff editor issueshelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code Insiders

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions