winmerge icon indicating copy to clipboard operation
winmerge copied to clipboard

UX issue when long lines have multiple differences

Open Gitoffthelawn opened this issue 2 years ago • 3 comments

WinMerge v2.16.33.0 has a UX issue that I have experienced several times.

The issue appears when the setting to view differences within lines is enabled.

When comparing 2 text files, I find the typical procedure to be to use the Next Difference toolbar button (or its keyboard shortcut) to scroll through all the differences to view them.

If a line in either file has more than one difference with the other file, and that line is too long to fit in the screen (common in JSON files, for example), the user will never see the difference when clicking on the Next Difference toolbar button (or its keyboard shortcut). This can lead the user to draw incorrect conclusions as to the data being presented by WinMerge.

Even when multiple differences are displayed on the same screen, if there is a large number of characters between them, it appears that WinMerge is making an error and is mistakenly skipping over some differences.

The workaround is to only use the Difference in the Current Line toolbar button. But this has 3 detractions, as compared to the Next Difference button:

  1. The icon for the Difference in the Current Line toolbar button does not clearly indicate its purpose, unlike the Next Difference toolbar button.
  2. There does not appear to be any keyboard shortcut for the Difference in the Current Line toolbar button (at the least, none is presented in its tooltip).
  3. Unlike the Next Difference toolbar button's companion Previous Difference toolbar button, there is no Previous Difference in the Current Line toolbar button.

One possible solution is to simplify the toolbar and remove its Difference in the Current Line button. Once removed, the Next Difference toolbar button (and its keyboard shortcut) would be be assigned to perform the behaviour of the current Difference in the Current Line toolbar button. Similarly, the Previous Difference toolbar button (and its keyboard shortcut) would perform the same action in the other direction.

The problem with this possible solution is when a file has many small changes within a single line. The user would then need to press the Next Difference toolbar button (or its keyboard shortcut) numerous times to get through the line. A possible resolution could be to add a Skip to Next Line button.

I have spent only a small amount of time thinking about possible solutions, so I welcome all to build on the ideas I have presented, or to present completely new ones.

Gitoffthelawn avatar Oct 02 '23 05:10 Gitoffthelawn

"Difference in the Current Line" is assigned to the F4 key. Also, press Shift+F4 to move to the previous inline difference.

I also think it would be effective to check "Automatically scroll to first inline difference" in the General category of the Options window.

sdottaka avatar Oct 02 '23 12:10 sdottaka

I added "(F4)" to the description of the toolbar icon "Difference in the Current Line" in commit 55ebe92.

sdottaka avatar Oct 02 '23 12:10 sdottaka

"Difference in the Current Line" is assigned to the F4 key. Also, press Shift+F4 to move to the previous inline difference.

I did not know that. Thank you.

I also think it would be effective to check "Automatically scroll to first inline difference" in the General category of the Options window.

Yes, I have that checked.

I do think the issue is significantly larger than just having a keyboard shortcut for Difference in the Current Line.

Gitoffthelawn avatar Oct 06 '23 08:10 Gitoffthelawn