Community
    • Login

    [New Plugin] ComparePlus v1.0.0

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    30 Posts 11 Posters 33.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • YaronY
      Yaron @Vitalii Dovgan
      last edited by

      @Vitalii-Dovgan,

      Any reason not to use the CustomizeToolbar plugin?
      IMO it’s a must-have plugin regardless of ComparePlus.

      Vitalii DovganV 1 Reply Last reply Reply Quote 2
      • pnedevP
        pnedev @Vitalii Dovgan
        last edited by

        @Vitalii-Dovgan ,

        I’ll consider your suggestion, thanks!

        BR

        1 Reply Last reply Reply Quote 3
        • Alan KilbornA
          Alan Kilborn @Michael Vincent
          last edited by Alan Kilborn

          @Michael-Vincent said in [New Plugin] ComparePlus v1.0.0:

          Command line usage? Are you serious!?!?! OMG, it works!

          I’m not able to get command-line use working.
          I presume that it is supposed to load the files and then start the compare on them, but that’s just a presumption on how I think it should work; I haven’t seen anything that says that.

          It loads the files, but doesn’t start the compare. The plugin itself loaded fine as I can see the toolbar buttons and I can start the compare manually, but…

          I think I’m doing it correctly:

          c1e9e026-a2ac-4882-81b2-dc7f2ef40b74-image.png

          2637cf2d-ba7e-4f45-ab04-1594e3fbaaa0-image.png

          Anyone have any hints for me?

          pnedevP 1 Reply Last reply Reply Quote 2
          • Bas de ReuverB
            Bas de Reuver
            last edited by

            I use the old Notepad++ Compare plug-in almost daily. So it’s great news that you’re continuing its development and keeping it active and up-to-date.

            I’ve seen other useful software tools slowly disappear due to software rot, so even if you hadn’t added new features I think it’s great just for the maintenance of such a useful utility 👍

            1 Reply Last reply Reply Quote 4
            • pnedevP
              pnedev @Alan Kilborn
              last edited by

              @Alan-Kilborn ,

              Try removing the quotes from compare - run it like that:

              --pluginMessage=compare

              Sorry for the misleading info in the description, my bad.

              Alan KilbornA 2 Replies Last reply Reply Quote 4
              • Vitalii DovganV
                Vitalii Dovgan @Yaron
                last edited by Vitalii Dovgan

                @Yaron said in [New Plugin] ComparePlus v1.0.0:

                @Vitalii-Dovgan,

                Any reason not to use the CustomizeToolbar plugin?
                IMO it’s a must-have plugin regardless of ComparePlus.

                The CustomizeToolbar has two tiny issues which are actually not issues for most of people but are issues for me. First, CustomizeToolbar makes Notepad++'s toolbar to blink (repaint) during start-up. Second, CustomizeToolbar slows down Notepad++'s startup for almost a second (for a cold start). As I wrote, these are not issues for most of the people, but I’m very sensitive to such things.

                1 Reply Last reply Reply Quote 1
                • guy038G
                  guy038
                  last edited by guy038

                  Hello, @pnedev and All,

                  Ah… OK !. So the correct syntax is :

                  ...\notepad++ -pluginMessage=compare Old_file.txt New_file.txt

                  Howewer, we have to consider different cases. Let’s consider a session with two files change.log and copy.log ( with a few changes compared to change.log) and some other tabs, too :


                  • The change.log and copy.log tabs exist, both, in current N++ session AND the copy.log tab comes next to the change.log tab. After closing N++ :

                  => The CMD command ...\notepad++ -pluginMessage=compare change.log copy.log works correctly

                  => The CMD command ...\notepad++ -pluginMessage=compare copy.log change.log does not work correctly


                  • The change.log and copy.log tabs exist, both, in current N++ session AND the change.log tab comes next to the copy.log tab. After closing N++ :

                  => The CMD command ...\notepad++ -pluginMessage=compare change.log copy.log does not work correctly

                  => The CMD command ...\notepad++ -pluginMessage=compare copy.log change.log works corectly


                  • The change.log and copy.log tabs exist, both, in current N++ session BUT the copy.log tab and change.log tab are not adjacent. After closing N++ :

                  => The CMD command ...\notepad++ -pluginMessage=compare change.log copy.log does not work correctly

                  => The CMD command ...\notepad++ -pluginMessage=compare copy.log change.log does not work correctly


                  • The change.log tab only exists in current N++ session and is the last one. After closing N++ :

                  => The CMD command ...\notepad++ -pluginMessage=compare change.log copy.log works correctly

                  => The CMD command ...\notepad++ -pluginMessage=compare copy.log change.log does not work correctly


                  • The change.log tab only exists in current N++ session and is not the last one. After closing N++ :

                  => The CMD command ...\notepad++ -pluginMessage=compare change.log copy.log does not work correctly

                  => The CMD command ...\notepad++ -pluginMessage=compare copy.log change.log does not work correctly


                  • The copy.log tab only exists in current N++ session and is the last one. After closing N++ :

                  => The CMD command ...\notepad++ -pluginMessage=compare change.log copy.log does not work correctly

                  => The CMD command ...\notepad++ -pluginMessage=compare copy.log change.log works correctly


                  • The copy.log tab only exists in current N++ session and is not the last one. After closing N++ :

                  => The CMD command ...\notepad++ -pluginMessage=compare change.log copy.log does not work correctly

                  => The CMD command ...\notepad++ -pluginMessage=compare copy.log change.log does not work correctly


                  • The two tabs change.log and copy.log do not exist in current N++ session. After closing N++ :

                  => The CMD command ...\notepad++ -pluginMessage=compare change.log copy.log works correctly

                  => The CMD command ...\notepad++ -pluginMessage=compare copy.log change.log works correctly


                  Of course, all the previous cases happen if the current session contains, in addition, some tabs different from change.log AND copy.log

                  In the rare cases where the current session contains only the two files change.log and copy.log or one of the two or no file at all :

                  => The CMD command ...\notepad++ -pluginMessage=compare change.log copy.log works correctly in all cases

                  => The CMD command ...\notepad++ -pluginMessage=compare copy.log change.log works correctly in all cases


                  So, @pnedev, I suppose that you need to define the first file with the Set as First to Compare option and, probably, a new Set as Second to Compare option, used internally, to define the second file, in order that the DOS prompt command ...\notepad++ -pluginMessage=compare Old_file.txt New_file.txt always starts the comparison of the given files in all cases ?!

                  Best Regards,

                  guy038

                  pnedevP Alan KilbornA 2 Replies Last reply Reply Quote 3
                  • Alan KilbornA
                    Alan Kilborn @pnedev
                    last edited by

                    @pnedev said in [New Plugin] ComparePlus v1.0.0:

                    Try removing the quotes from compare - run it like that:
                    –pluginMessage=compare
                    Sorry for the misleading info in the description, my bad.

                    That works; thanks.

                    1 Reply Last reply Reply Quote 4
                    • pnedevP
                      pnedev @guy038
                      last edited by

                      Hello @guy038 ,

                      You are right. The command line compare works correctly only in case there is no auto-restored session. Otherwise it might mess things up.
                      I’ll look into it for the next version, thanks.

                      BR

                      1 Reply Last reply Reply Quote 3
                      • Alan KilbornA
                        Alan Kilborn @guy038
                        last edited by

                        @guy038

                        Maybe also test with the N++ argument -noSession ?

                        1 Reply Last reply Reply Quote 2
                        • guy038G
                          guy038
                          last edited by guy038

                          Hi, @pnedev, @alan-kilborn, @yaron and All,

                          @pnedev, don’t bother about my previous post ! No need to investigate further about the provided cases. The solution was obvious ! Always use the syntax :

                          ...\notepad++ -nosession -pluginMessage=compare Old_file.txt New_file.txt

                          BTW, @alan-kilborn, the parameter to use is -nosession ( and not -noSession ) !

                          Best Regards

                          guy038

                          Alan KilbornA 2 Replies Last reply Reply Quote 3
                          • Alan KilbornA
                            Alan Kilborn @guy038
                            last edited by

                            @guy038 said in [New Plugin] ComparePlus v1.0.0:

                            the parameter to use is -nosession ( and not -noSession )

                            You’re right. However, I will take the opportunity to say that it is a bit odd that it is this way (all lowercase) when, -openSession (one I use often) is mixed case.

                            1 Reply Last reply Reply Quote 3
                            • Alan KilbornA
                              Alan Kilborn @guy038
                              last edited by Alan Kilborn

                              @guy038 said in [New Plugin] ComparePlus v1.0.0:

                              don’t bother about my previous post ! No need to investigate further about the provided cases. The solution was obvious

                              I don’t know that I agree fully with that.

                              It seems reasonable to want to do a command line compare and start the compare automatically between the 2 files where the files are loaded into a running Notepad++'s current session.

                              Of course, a user doing this would probably want to close the 2 files when they are done analyzing the compare, to avoid the files remaining in the remembered session, but even that is not a certaintly.

                              I suppose -nosession is ignored if N++ is already running (with a session) and another command line invocation of notepad++.exe occurs (without -multiInst).

                              Maybe that’s the ultimate solution for something like a “git difftool” solution using this new plugin capability: using -multiInst -nosession -pluginMessage=compare…

                              1 Reply Last reply Reply Quote 5
                              • Alan KilbornA Alan Kilborn referenced this topic on
                              • Alan KilbornA
                                Alan Kilborn @pnedev
                                last edited by

                                @pnedev said in [New Plugin] ComparePlus v1.0.0:

                                Try removing the quotes from compare - run it like that:
                                –pluginMessage=compare

                                So is this actually a bug in the ComparePlus plugin?
                                (I don’t mean the -- part, which obviously should have just been -, I mean the lack of quotes)

                                From the description in the N++ user manual HERE, I’d say a correct argument looks like this:

                                -pluginMessage="compare filepath1 filepath2"

                                (And of course, if either of the filepaths contains spaces, then my brain is starting to hurt, but…)

                                Does it work without the double quotes because it must be used as the last argument on the N++ command line, and anything after -pluginMessage= is passed to the plugin and not looked at at all by N++?

                                And how does N++ know that this specific one is meant for the ComparePlus plugin? Or does this same message get sent to all plugins? (that would strike me as “not a good thing”)

                                pnedevP 1 Reply Last reply Reply Quote 0
                                • guy038G
                                  guy038
                                  last edited by guy038

                                  Hello, @pnedev, @alan-kilborn and All,

                                  Alan, I did some tests with files with a space character. If I assume that no instance of Notepad++ is running before each test, the command line behavior of the Compare-plus plugin is presently :

                                  • notepad++ -nosession -pluginMessage=compare "E:\844_x64\cha nge.log" "E:\844_x64\cop ie.log" opens a new instance of N++ with the two tabs cha nge.log and cop ie.log only which are correctly compared

                                  • notepad++ -nosession -pluginMessage="compare E:\844_x64\cha nge.log E:\844_x64\cop ie.log" opens a new instance of N++ with the new 1 tab only

                                  • notepad++ -nosession -pluginMessage="compare" "E:\844_x64\cha nge.log" "E:\844_x64\cop ie.log" opens a new instance of N++ with the two tabs cha nge.log and cop ie.log only but without any comparison process

                                  Best Regards,

                                  guy038

                                  Alan KilbornA 1 Reply Last reply Reply Quote 1
                                  • Alan KilbornA
                                    Alan Kilborn @guy038
                                    last edited by

                                    @guy038

                                    Your analysis is good to know, and thank you, but lest anyone think your reply fully answers my questions, it does not. If no one else replies, then perhaps to get to the bottom of it, a dive into the source code for Notepad++ is going to be in order.

                                    1 Reply Last reply Reply Quote 0
                                    • pnedevP
                                      pnedev @Alan Kilborn
                                      last edited by pnedev

                                      @Alan-Kilborn ,

                                      The compare trigger is
                                      -pluginMessage=compare exactly (thanks for the double -- notice. The quotes must be omitted from the plugin message.
                                      All plugins (that care about it) may parse the string after the equality sign (so the string compare gets to all plugins that care to check it). This should not be a problem and ComparePlus cannot avoid that.
                                      The right way to go is to compare the files that are given on the command line but outside the pluginMessage string. That is because this way Notepad++ actually opens the files automatically and I don’t have to open them myself :) (which is of course not that much of a problem but its better to leave that to Notepad++) and because of the spaces in the files (or their path) as you mentioned although that might be avoided as in Python by using single quotes for example.

                                      My idea was to give the user a way to quickly and directly trigger compare from the command line and not to do some sophisticated things (at least that was the initial intention).
                                      I am working on the sessions problem and which file is the first and the second and which of the two is considered the new and which the old. Other than that I don’t intend to change the compare process trigger (that is the -pluginMessage=compare option) as it serves its purpose. If you think it is not enough and might bring confusion or problems please share your thoughts on such cases and your ideas and I will consider them.
                                      I appreciate your feedback, thanks.

                                      @guy038 ,
                                      Thanks for the tests. Just to mention that in your last try the comparison was not started because the compare was in quotes. If only one file is given on the command line the comparison should not start (at least that’s the intention).
                                      Thank you.

                                      BR

                                      1 Reply Last reply Reply Quote 4
                                      • pnedevP
                                        pnedev
                                        last edited by

                                        @Alan-Kilborn ,

                                        Several more things to directly answer your questions and to give you some idea on the Notepad++ implementation for the plugin messages (at least as I remember it and as I understand it):

                                        So is this actually a bug in the ComparePlus plugin?

                                        I don’t consider it a bug, it is simply how I have implemented that functionality.

                                        Does it work without the double quotes because it must be used as the last argument on the N++ command line, and anything after -pluginMessage= is passed to the plugin and not looked at at all by N++?

                                        Again, it works that way because I have implemented it that way and it is not meant to be the last option on the command line.
                                        I think Notepad++ will get everything after -pluginMessage= and send it to the plugins regardless of the quotes. If there are quotes then the message will include the spaces inside otherwise it will stop on the first space. That’s my idea on that, I haven’t checked it (at least now) but I surely have done some tests back then when I implemented the message parsing.

                                        And how does N++ know that this specific one is meant for the ComparePlus plugin?

                                        It doesn’t know. It sends the message to all plugins.

                                        So what I understood about the Notepad++ “message to plugins” function when I was implementing the handling in CP is that on Notepad++ start it parses the command line and sends dedicated message to all plugins with the string from the command line.
                                        I didn’t like that enough for my needs so I implemented N++ command line parsing directly in CP and I do not handle the N++ plugin message. I wanted to avoid parsing the plugins message string because that would mean that I had to avoid accidentally matching “compare” word if another plugin used it or to implement some other more distinctive string to trigger compare.
                                        I wanted the compare trigger to be something simple so the user doesn’t have to write much on the command line so I simply check if the command line contains -pluginMessage=compare.

                                        1 Reply Last reply Reply Quote 4
                                        • Terry RT Terry R referenced this topic on
                                        • pnedevP
                                          pnedev
                                          last edited by

                                          Hello all,

                                          ComparePlus v1.1.0 is ready.
                                          These are the release notes - shortly, several bugs have been fixed, the command line issues discussed here have been resolved (the command line should be notepad++ -pluginMessage=compare new_file.txt old_file.txt and as @Vitalii-Dovgan suggested there are settings to enable/disable the toolbar icons.
                                          The new version of the plugin is using the new Scintilla headers coming with Notepad++ v8.4.7 but I have tested it with N++ v8.4.6 as well and it worked OK.
                                          Enjoy!

                                          BR

                                          datatraveller1D 1 Reply Last reply Reply Quote 6
                                          • datatraveller1D
                                            datatraveller1 @pnedev
                                            last edited by datatraveller1

                                            Hi @pnedev,
                                            I have installed Notepad++ v8.4.7 and then ComparePlus with the Plugins Admin, but this is version 1.0. I can’t see a newer version with Plugins Admin - Updates. Will it take some time until it appears there?

                                            Alan KilbornA PeterJonesP 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            The Community of users of the Notepad++ text editor.
                                            Powered by NodeBB | Contributors