Skip to content
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

Diff algorithm detects two consecutive added lines as two changes (instead of one) #119051

Closed
bersbersbers opened this issue Mar 16, 2021 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug diff-editor Diff editor issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@bersbersbers
Copy link

bersbersbers commented Mar 16, 2021

  • VS Code Version: 1.54.3
  • OS Version: Windows 10, SSH to Linux

Steps to Reproduce:

  1. bug1.txt:
1


2

  1. bug2.txt:
1

1.5


2

3

  1. Compare selected

Result:
image

This diff is not wrong, but it's not minimal. The first two changes could be merged into one, just like diff does it:

> diff bug1.txt bug2.txt 
2a3,4
> 1.5
> 
4a7,8
> 
> 3

Interestingly, removing the final line break from bug2.txt prevents the issue:
image

Does this issue occur when all extensions are disabled?: Yes

@alexdima alexdima added bug Issue identified by VS Code Team member as probable bug diff-editor Diff editor issues labels Mar 19, 2021
@alexdima alexdima added this to the March 2021 milestone Mar 19, 2021
@rzhao271 rzhao271 added the verified Verification succeeded label Mar 24, 2021
@bersbersbers
Copy link
Author

Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators May 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug diff-editor Diff editor issues insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants
@alexdima @rzhao271 @bersbersbers and others