pnedev / comparePlus

Compare plugin for Notepad++
GNU General Public License v3.0
1.01k stars 139 forks source link

Feature request - Jump to differences within the line #377

Closed mike406 closed 9 months ago

mike406 commented 9 months ago

Hello, I will try to explain this feature request the best way I can. Say for example you compare two files and on a line the only diff happens to be a couple of characters. Maybe this line is 10,000 characters long. It is a bit tedious to horizontally scroll through this line to find where the difference really lies. I see that ComparePlus does highlight these differences in a darker color, but I do not see a way to jump to them. The "Next" and "Previous" buttons seem to only jump lines. If it would be possible to jump to the actual position the character difference lies I think that would be very useful. If there is already a way to do this and I just didn't see it, please let me know. Thank you.

pnedev commented 9 months ago

Hello, There is currently no easy way to do this. I will add new command to go to the next change on a line and write back. BR

pnedev commented 9 months ago

Implemented and will be included in the future releases. You'll need to use the development build for now and manually update your ComparePlus.dll with the development one (tell me if you need instructions for that). Make sure you take the appropriate dll build for your platform: Win 32-bit / Win 64-bit

Yaron10 commented 9 months ago

Hello Pavel,

I hope you're doing well.

Thank you for this new feature. I appreciate your work. Could you please test it with the following text?


preferexncessssssssssssDlg.cpp        ccccccccccccccccc
NppCommands.cpp

PluginsManager.cpp
Notepad_plus_msgs.h

NppBigSwitch.cpp
Parameters.h
preferexncezssssssssssssDlg.cpp        cccccccccccccccccc
NppCfffffffffffffommands.cpp

PluginsManager.cppa
Notepad_plus_msgs.h

NppBigSwitch.cpp
Parameters.h

תמונה


Place the caret at pos 1. Next Change Position.

Result: You jump to the end of the first Changed block. Shouldn't you go to the beginning of the second block?


Place the caret at the end of line 1. Next Change Position.

Result: You jump to the Changed block in line 4. Isn't the purpose of this feature moving between Changed blocks in the current (long) line? - Otherwise, one might request Next Added Position as well.


The main ComparePlus menu has become too long IMO. (On relatively smaller monitors, you need to scroll up/down).

How about Bookmark Diffs in a popup? And the Ignore options?


I also hardly have free time these days. I hope we'll manage that. :)

Best regards.

pnedev commented 9 months ago

Hello Yaron,

Thank you for the feedback.

I meant this change as a quick fix for the requester and haven't thought a lot about polishing it - I really don't have the time and the energy for that :/ About the new feature - the behavior is as expected although you are right of course - going to the end of the changed section is not optimal but is the quickest approach I had (no additional checks and handling needed). Going to the next changed line is also something that is not requested and is a "side effect". I will fix those things when I find the time.

You are also right about the length of the ComparePlus menu. Maybe creating sub-menus is the way to go - it is better for "Bookmark...." entries IMO. For "Ignore..." entries pop-up might be appropriate as well or again sub-menu. What do you think (for sure it will be something for the near/far future)? Thank you for the suggestions, appreciated as always.

All the best, Pavel

Yaron10 commented 9 months ago

Hello Pavel,

I really don't have the time and the energy for that

We're synced in that. Whenever you have time, it would be appreciated.

I meant this change as a quick fix for the requester

Let's wait for @mike406's reply. It might be a nice feature, but I'm not sure it's worth your time and work.

As for placing the Ignore options in a sub-menu... I don't know. It might be better to think about it in the future.

I hope we should both get more "time and energy". :) Thank you again my friend.

BR

mike406 commented 9 months ago

For my use case, this change works well thank you very much @pnedev. @Yaron10 for the example you have given it helps if you enable "Detect character diffs" then it works as expected in my testing.

Yaron10 commented 9 months ago

@mike406,

I'm glad Pavel has solved your issue.

pnedev commented 9 months ago

@mike406 , Thank you for the feedback 👍

@Yaron10 , Thank you for the feedback and the suggestions as well. 👍

I will keep the implementation as it is now then (except that I have already added a check if the visited change is on the current line - if it is on another line the cursor is not moved there). Here are the new binaries: Win 32-bit / Win 64-bit

Yaron10 commented 9 months ago

Hello Pavel,

Thank you for the recent improvement. I appreciate it. 👍

BR

pnedev commented 9 months ago

Thank you, Yaron. I have also added blinking of the line if we have reached the last change position (or if we are on a line without changes) to resemble the other navigation commands. I just need to upload the changes to Git.

BR

Yaron10 commented 9 months ago

Great! 👍

Do you think the current wording is clear enough? How about something like "Next Diff in Changed Line"?

Thank you.

BR

pnedev commented 9 months ago

Hello Yaron,

The wording you suggest is perfect, I will use that. Thank you for the good idea 👍

BR

Yaron10 commented 9 months ago

Hello Pavel,

I'm glad you agreed. Thank you again for your time and work. 👍

BR

Yaron10 commented 8 months ago

Hello Pavel,

Congratulations on the new version. 👍 Thank you very much for your work.

BR

pnedev commented 8 months ago

Thank you, Yaron 👍

BR