Set As First To Compare button not being respected
Opened this issue · 2 comments
I am comparing two files. File One is the original file, in the first tab of a single view. File Two is the modified file, with lines added in to it, in the second tab of a single view.
Settings are:
First is: Old File
Old file position: Left/Top
Single-view default compare to: Previous
If I use the Set As First To Compare button on File One (first tab), then click the Compare button, File One moves to the right of the screen ("other view"), and shows grey gaps where lines have been added in File Two. File Two stays on the left of the screen, and incorrectly shows in red lines as having been removed from the file.
Expected behavior is that File One, marked as the First File, should stay on the left, and File Two should move to the right and show in green that lines have been added.
Notepad++ 8.4.4
Compare Plugin 2.0.2
Please remove Compare Plugin and install the much-improved ComparePlus by @pnedev.
The new plugin should be available in Notepad++ v8.4.5 PluginAdmin.
https://community.notepad-plus-plus.org/topic/23450/notepad-v8-4-5-release
https://community.notepad-plus-plus.org/topic/23434/new-plugin-compareplus-v1-0-0
If you still have an issue, please post it in https://github.com/pnedev/comparePlus.
@quattj ,
If I use the Set As First To Compare button on File One (first tab), then click the Compare button, File One moves to the right of the screen ("other view"), and shows grey gaps where lines have been added in File Two. File Two stays on the left of the screen, and incorrectly shows in red lines as having been removed from the file.
I suspect you haven't changed the current (active) file to File Two before clicking the Compare button.
The configuration you described means that when you use Set as first
you select the old file but then you have to switch to the other file before starting the comparison. The plugin needs to know which is the second file and this is the active one before the compare.
If you simply use Set as first
and then start compare from the same file the plugin couldn't know which is the second file and falls back to Single-view default compare to
scenario which in your case is "compare current file to the previous one".
I have forgotten the details of the Compare-plugin implementation so the above is just an assumption. Best is to follow Yaron's advice.