[New Plugin] ComparePlus v1.0.0
-
Awesome!
For all of you who are looking for a link to the repo, like me, here it is: pnedev/comparePlus. -
@pnedev
Thank you for the release!
And I have a feature request :)
This plugin adds 10 toolbar buttons. Could you add an option (or options) to select whether we want any button on the toolbar or, as an enhanced version, to specify which exact buttons we want or do not want on the toolbar? For example:----------------------------------- | [ ] Show Toolbar buttons | | [ ] Set as First to Compare | | [ ] Compare | | [ ] Compare Selections | | [ ] Clear Active Compare | | ... | -----------------------------------
-
@Vitalii-Dovgan said in [New Plugin] ComparePlus v1.0.0:
This plugin adds 10 toolbar buttons.
Wow, 10 toolbar buttons seems excessive. Maybe this would have been better served by having a dedicated panel for this plugin, similar in base concept to the panel in the Changed Lines plugin.
-
Any reason not to use the CustomizeToolbar plugin?
IMO it’s a must-have plugin regardless of ComparePlus. -
-
@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:
Anyone have any hints for me?
-
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 👍
-
Try removing the quotes from
compare
- run it like that:--pluginMessage=compare
Sorry for the misleading info in the description, my bad.
-
@Yaron said in [New Plugin] ComparePlus v1.0.0:
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.
-
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
andcopy.log
( with a few changes compared tochange.log
) and some other tabs, too :
- The
change.log
andcopy.log
tabs exist, both, in current N++ session AND thecopy.log
tab comes next to thechange.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
andcopy.log
tabs exist, both, in current N++ session AND thechange.log
tab comes next to thecopy.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
andcopy.log
tabs exist, both, in current N++ session BUT thecopy.log
tab andchange.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
andcopy.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
ANDcopy.log
In the rare cases where the current session contains only the two files
change.log
andcopy.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 newSet as Second to Compare
option, used internally, to define the second file, in order that theDOS
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
- The
-
@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.
-
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
-
Maybe also test with the N++ argument
-noSession
? -
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
-
@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. -
@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 ofnotepad++.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
… -
-
@pnedev said in [New Plugin] ComparePlus v1.0.0:
Try removing the quotes from compare - run it like that:
–pluginMessage=compareSo 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”)
-
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 tabscha nge.log
andcop 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 thenew 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 tabscha nge.log
andcop ie.log
only but without any comparison process
Best Regards,
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.
-
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 stringcompare
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 thepluginMessage
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 thecompare
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