Page 1 of 1

Compare by contents with multiple files selected at least in one panel

Posted: 2024-10-04, 15:28 UTC
by wanderer
When multiple files are marked in one of the panels (i.e more than 1), it would be nice if cm_CompareFilesByContent did not compare the first selected file in both panels. IMO, most of the time it's not useful (especially after executing cm_CompareDirs).

It would be better if it first checked if the selected file in the active panel (the one on which the cursor is placed) exists in the other panel and if so, compare those two files ignoring what is selected in both panels.

For instance, in this image, it should try to compare "File 2" in both panels, not "File 1" with "File 4" as done today.

If only one file is selected in each of the panels, it should works as today, compare those two selected files.
If two files are selected in one of the panels and none in the other, it should compare those two selected files.
If two files are selected in one of the panels and at least one in the other, it should work as proposed in this post.

A new INI option could be added that would change the way things work between what exists today and what is proposed above.

Re: Compare by contents with multiple files selected at least in one panel

Posted: 2024-10-04, 19:32 UTC
by petermad
2wanderer

Until your suggestion might get implemented, you can use this button to compare the file under the cursor with a file with the same name in the other panel, no matter how may files are selected in either panel:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_EXE% /i="%COMMANDER_INI%" /S=C
%P%N %T%N
wcmicons.dll,49
Compare file under cursor with file with same name in other panel


-1
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".

Re: Compare by contents with multiple files selected at least in one panel

Posted: 2024-10-05, 09:08 UTC
by wanderer
That's great, works as expected. Thanks!

Re: Compare by contents with multiple files selected at least in one panel

Posted: 2024-10-07, 09:25 UTC
by wanderer
Ah, that works great only if the active panel is the left. If the right panel is active, CompareByContents shows the files reversed.

What i mean:
Left panel: Older file
Right panel: Newer file

If the active panel is the Right panel and you select the "Newer file", the button opens CompareByContents window and places that file in its Left panel! It's a little confusing but from what i've checked in the available parameters, there is no way to overcome this (apart from creating yet another button), right?

Re: Compare by contents with multiple files selected at least in one panel

Posted: 2024-10-07, 12:34 UTC
by Fla$her
2wanderer
For this purpose, %X is used at the beginning of the parameters. It's strange that petermad didn't do it right away, because such examples have been given here many times.

Re: Compare by contents with multiple files selected at least in one panel

Posted: 2024-10-07, 14:53 UTC
by petermad
wanderer wrote: 2024-10-07, 09:25 UTC Ah, that works great only if the active panel is the left. If the right panel is active, CompareByContents shows the files reversed.
Sorry for that - this should fix it:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_EXE% /i="%COMMANDER_INI%" /S=C
%X%P%N %T%N
wcmicons.dll,49
Compare file under cursor with file with same name in other panel


-1

Re: Compare by contents with multiple files selected at least in one panel

Posted: 2024-10-07, 15:07 UTC
by wanderer
Wow! I'm impressed TC already had a solution for this. It seems i've missed it.

Many thanks for it.