Compare Plugin



  • Hello,

    Jean Sebastien Leroy, Compare Plugin’s creator, abandoned the project a long time ago.
    UFO has fixed some bugs and added many improvements.
    Unfortunately, he has probably quit as well. We miss you UFO. :)

    UFO’s v1.5.6.7 has not been completed.
    In some cases this version throws an exception and crashes.
    (Uncheck “Ignore Spacing” and compare the files in Test.zip).

    Changing

    #define VARRAY_INIT_SIZE 16
    

    to

     VARRAY_INIT_SIZE 5
    

    (in varray.h) seems to solve the problem.

    I’ve also made the following changes:

    • Remove the Progress Bar introduced in v1.5.6.7.
    • Some minor improvements in comparing with Wrap mode on.
    • Fix the shortcuts for Next, Prev, etc…
    • An option to close the compared files if they match.

    I’ve made a version with new images for the Compare margin.

    better images

    The background is set to my “Line Number Margin” background color: RGB 228 228 228.
    If anyone knows how to change the XPM images background to transparent, I’d appreciate it.
    (The relevant files are: icon_add_16.h, icon_moved_16.h, icon_sub_16.h and icon_warning_16.h).
    ** The menu items and toolbar buttons are never disabled in this version.

    **
    I’m sure many users would appreciate an experienced developer willing to continue the work on this useful plugin.
    **

    Regards.

    ComparePlugin NewImages.v1.5.6.7.bin.zip
    ComparePlugin.v1.5.6.7.bin.zip
    Test.zip



  • Hello Yaron,

    First of all, I wish you, your family and friends, an excellent year 2016. I would like to say “better than 2015”. Unfortunately, the recent events, all over the world, contradict my talk !

    Many thanks for proposing, both, your modified 1.5.6.7 version of UFO and your second version, with the new icons for the lines added, removed, changed or moved !

    After testing these both versions, some points ( without any order ):

    • I agree that the Progress bar dialog feature should be of few interest, because it’s must be very difficult to estimate the real remaining time ! In addition, this adding may, likely, slow down the overall compare process !

    • Indeed, your new shortcuts are more appropriate ( no collision with the Next Tab and Previous Tab shortcuts )

    • In the version 1.5.6.7, the zoom levels, of the two N++ views, are synchronized, when comparing. It’s a nice improvement ! Unfortunately, this feature does NOT work, in your last version, with new images :-((

    • Your new option for closing the two compared files when they are strictly identical is an interesting feature, too :-)) However, when this new dialog appears : Files match. Close compared files?

      • The ESC key does NOT close the dialog, with the implicit No answer, as well as a left mouse click on the close button :-(

      • I’m wondering if the NO button should be, rather, the default one ?. If you consider this modification ( No obligation at all, of course ! ), there are two solutions to reverse the logic of that dialog :

        • Change the text of the dialog, as Files match. Keep compared files[ opened]? ( and the appropriate code, too ! )

        • Select the NO button as the default one, like, for instance, the Are you sure? dialog, when you click on the Replace in Files button of the Find in Files window

    Best Regards,

    guy038



  • Hello guy038,

    Thanks for the wishes. You are a kind gentleman.
    A good and happy year for you and your loved ones.
    And, indeed, a better year for the world in general and France in particular.

    Special thanks for testing and for your intelligent comments. The sharpest eye around. :)

    • The Progress Bar might be a good idea for large files.
      UFO and Pavel had a difficult time making it work properly. They are the experts; I didn’t even try.
      Actually, a “Busy” cursor could be a good solution too.

    • I intentionally removed the Zoom Sync in the version I use personally.
      Re-added in the attached file.

    • I often compare a good few sets of files, and if they match I want to close them.
      But you’re right: it might not be everyone’s preferred behavior.
      I’ve rebuilt it with “No” as the default button.

    • As for the ESC key:

    If a message box has a Cancel button, the function returns the IDCANCEL value if either the ESC key is pressed or the Cancel button is selected. If the message box has no Cancel button, pressing ESC has no effect.

    https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx

    • The Close button is disabled in a MB_YESNO message box.
      I’m not sure I understand what you mean by “with the implicit No answer”. :)

    Best regards.

    ComparePlugin.v1.5.6.7 NewImages NoDefault.bin.zip
    ComparePlugin.v1.5.6.7 OldImages NoDefault.bin.zip



  • Hi, Yaron,

    Many thanks for creating these modified releases, so quickly :-))

    They both work, as expected, with the zoom synchronization and the default No button, when a complete match occurs.

    BTW, when I said, in my previous post,

    The ESC key does NOT close the dialog, with the implicit No answer, as well as a left mouse click on the close button :-(

    I just pointed out that, IF a Cancel button is available, in a dialog box, hitting the ESC key or mouse clicking on the red cross icon, in the top right corner of the dialog, is strictly equivalent to mouse clicking on the No button !


    I don’t ask for this new feature, but I’m wondering :

    As you, seemingly, want to keep the zoom levels of your two N+ views, for your own needs, may be it would be possible to temporary store the current zoom level, of each view, in order :

    • To synchronize the zoom levels of the two views, during the compare process ( ALT + D )

    • To get back to these initial zoom levels, after a Clear Results command ( CTRL + ALT + D ) !

    So, you wouldn’t have to build two versions of your plugin ! ( one with zoom synchronization, and the other without ). Of course, I don’t even know if that goal is technically possible to reach ?

    Cheers,

    guy038



  • Hello guy038,

    My pleasure.
    If you regularly use Compare, I’m glad I’ve been able to slightly reciprocate to your kind and wise help to everyone on this forum. :)

    Ede123 has referred me to jsleroy’s current repo.
    If anything happens there, your contribution would be highly appreciated.

    As for the Zoom Sync:
    Thanks for the suggestion.
    I never change the zoom level and therefore removed the relevant code in the version I use.

    I forgot to mention another modification: a sound notification when wrapping around (i.e. if you reach the last diff and press Next - a beep will play in addition to the window flash).

    Best regards.



  • Hello,

    I owe UFO an apology.
    What I thought was an improvement in comparing with Wrap mode, is actually a regression (back to v1.5.6.3 behavior) in many cases.
    (Compare the files in Test2.zip).

    We shouldn’t use NPP vertical scroll sync but rather UFO’s “case SCN_UPDATEUI:”.


    NPP enabling and disabling the Sync Scroll commands is somewhat inconsistent.
    Therefore my changes relating to restoring the Sync Scroll state are too complex and not worth it.
    Back to UFO’s Restore Sync Scroll.

    See guy038’s comment and UFO’s reply.

    Best regards.

    ComparePlugin.v1.5.6.7.NewImages.NoDefault.bin.zip
    ComparePlugin.v1.5.6.7.OldImages.NoDefault.bin.zip



  • Using your files found in Test.zip:
    Compare 1.5.6.4 (UFO) and below - correct navbar https://i.imgur.com/JMybhaZ.png (well, more or less, as there are too many lines to fit in this small window anyway)
    Compare 1.5.6.5 (UFO) and above (including your new builds) - incorrect https://i.imgur.com/nXJNG1N.png



  • Hello Doutei,

    I never use the NavBar and did not follow UFO’s relevant changes.
    It’s possible that UFO decided to ignore one-line-blocks.

    Could you open an issue here?
    Jean Sebastien and/or Pavel might look into it.

    Best regards.



  • Plugin good. But I would like to display the number of similar / different lines in figures or percentages.



  • Hello Did,

    I’d like to have this feature too.
    Please see this issue.

    Best regards.



  • Hi guys,
    I’ve installed notepad++ to compare .cs files but it doesn’t work.
    1- open both files
    2- plugin
    3- compare
    4- compare
    then I saw “unknown exception” error.
    any suggestions?!!



  • Sonia HI.

    I had compare troubles where the plugin was destroying returning to the previous explorer file listing (for instance) which i traced down to the compare plugin. After a hell of a lot of wasted time and tracking down I find that 1.5.6.6 does actually work for me in comparing as well as returning focus to the original program once Notepad++ has been closed. So I recommend 1.5.6.6. from [https://bitbucket.org/uph0/compare/downloads](link url).

    Also a dose of Good luck. MInsik.



  • Hello Yaron, thanks for changes you made on plugin. I used old one until now and i have a lot of troubles with it.
    You and UFO have made great job! :-)

    I have one proposal for improvement. It will be nice to have a options to change color(or reverse alpha) of text in highlighted areas. I have the dark theme with light color text and when selected lines have bright background(default yellow or green) then the text fades in background.



  • Hello Petr,

    Thanks. UFO deserves the flowers. :)
    Pavel Nedev has been working on a new version. Yo can open an issue here.

    Best regards.



  • hello Yaron,

    Could you provide a 64-build of compareplugin, please?

    Thanks



  • Hello crayxt,

    Pavel Nedev’s excellent version (both x32 & x64) is available here.

    Best regards.



  • Thank you Yaron!



  • You’re welcome.



  • @Yaron said:

    Hello crayxt,

    Pavel Nedev’s excellent version (both x32 & x64) is available here.

    Best regards.

    Yaron, thanks to your comment, I downloaded the “cp-pnedev-0094-d8e277588455e43f16041566073126e706185960.7z” file from Pavel’s DropBox page to test the 64bit version. It works, with the following caveat:

    1. If Notepad++ 7.2.2 x64 is launched, but the Compare plugin is never used, Notepad++ crashes on Exit.
    2. If Notepad++ 7.2.2 x64 is launched, and the Compare plugin is used, Notepad++ does not crash on Exit.
      .

    In the 7z archive file, I noticed the 32bit Compare plugin version includes a “ComparePlugin” folder with two files in it: git2.dll & sqlite3.dll. However, in the 64bit Compare plugin version, the “ComparePlugin” folder is empty. I was able to find a 64bit version of sqlite3.dll online from the sqlite organization, but git2.dll seems to be development language specific (there is no generic 64bit version available). The Compare plugin works without these 64bit DLLs, but I’m wondering if they are needed to prevent Notepad++ from crashing on exit if the Compare plugin is not used.

    If you have any insight on whether the 64bit “ComparePlugin” DLLs are necessary, or if you can pass this note along to Pavel Nedev, it would be appreciated.

    I look forward to your response.

    Best regards.

    -Jay



  • Regarding my previous post, the same problem occurs with the 32bit version of the Compare plugin in Notepad++ 7.2.2 32bit…

    1. If Notepad++ 7.2.2 is launched, but the Compare plugin is never used, Notepad++ crashes on Exit.
    2. If Notepad++ 7.2.2 is launched, and the Compare plugin is used, Notepad++ does not crash on Exit.
      .

    I’m still unsure about the importance of the git2.dll & sqlite3.dll files located in the “ComparePlugin” folder, but the crash on exit occurs on both 32bit & 64bit versions of Notepad++. (Removing “ComparePlugin.dll” from the Notepad++ plugins folder resolves the problem)


Log in to reply