ryu1kn / vscode-partial-diff

Visual Studio Code Extension. Take a diff of 2 parts of text(s)
https://marketplace.visualstudio.com/items?itemName=ryu1kn.partial-diff
MIT License
184 stars 15 forks source link

Full diff sometimes compares second file to itself #43

Closed MatthewFergus closed 4 years ago

MatthewFergus commented 5 years ago

Using this feature listed in the readme:

Executing Select Text for Compare, Compare Text with Previous Selection or Compare Text in Visible Editors command without selecting any text will use the entire text of the current file.

I right click with no selection in my first file and choose Select Text for Compare, then right click and choose Compare Text with Previous Selection in the second. Sometimes when I do this the diff incorrectly shows the diff between the second file and itself. This can be easy to miss if the two files have the same name, leading you to think there are no differences when there actually are. This has got me a few times now. If I repeat the steps the diff is shown correctly.

I can reliably reproduce this by opening two files, relaunching visual studio code and quickly diff them just after the files reopen.

ryu1kn commented 5 years ago

Thanks for reporting it. Interesting, I wonder if the extension is not loaded up yet when this happens. Do you see any errors if you open "Toggle Developer Tools"?

MatthewFergus commented 5 years ago

No worries. I had a look and can't see any errors in the developer tools console after triggering the issue.

I'll also note that I've also seen this happen when vs code has been running a while. Relaunch is the only way I can find to reliably reproduce it though.

ryu1kn commented 5 years ago

Thanks @MatthewFergus for checking the console output. The extension only starts when we trigger one of those commands; so it still makes sense that relaunching is the way to reproduce it.

ryu1kn commented 4 years ago

Fixed in v1.4.1 ✅