Wrong %c1/%c2 when unique file is selected and not focused

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Wrong %c1/%c2 when unique file is selected and not focused

Post by *MVV »

When I select unique file in a panel and focus two-sided file and then press buttonbar button, one of %c1/%c2 parameters for inactive panel passes wrong filename (focused one instead of selected one) while %C1/%C2 parameters pass proper files.

Tests:
0. Open C:\Test\Left folder in left panel and C:\Test\Right folder in right panel.
1. Select LeftOnly.txt file in left panel and focus Both.txt file, then press test button. All %c/%C parameters pass proper file LeftOnly.txt (except %c2 which passes Both.txt).
2. Select RightOnly.txt file in right panel and focus Both.txt file, then press test button. All %c/%C parameters pass proper file RightOnly.txt (except %c1 which passes Both.txt).

Test environment:
- Folder C:\Test\Left contains files Both.txt, LeftOnly.txt
- Folder C:\Test\Right contains files Both.txt, RightOnly.txt
- Sample buttonbar button for test:

Test button:

Code: Select all

cmd.exe 
/c "echo c: %c & echo c1: %c1 & echo c2: %c2 & echo C: %C & echo C1: %C1 & echo C2: %C2 & pause"
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Confirmed !
c1 and c2 passes the filename under cursor, not the selected filename as it should be, if only 1 file is selected in active panel and 0 files are selected in inactive panel. The path is correct - it is only the filename that is passed wrongly.
Last edited by petermad on 2018-01-18, 17:53 UTC, edited 1 time in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Hmm, isn't this the same name selection as when you use "compare by content"?
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ghisler(Author),
Problem is in case when one-side file selected, internal comparer in such case shows empty path for target file, %C1/%C2 currently pass path to file that matches selected one as if it would exist in target panel, but %c1/%c2 passes file that matches focused file instead.

When I open D:\New\LEFT dir, select LeftOnly.txt file and focus Both.txt file in left panel, I get following variables:

Code: Select all

c: D:\New\LEFT\LeftOnly.txt
c1: D:\New\LEFT\LeftOnly.txt
c2: D:\New\RIGHT\Both.txt             <- inconsistent value, wrong filename
C: D:\New\LEFT\LeftOnly.txt
C1: D:\New\LEFT\LeftOnly.txt
C2: D:\New\RIGHT\LeftOnly.txt
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Ah, I see - so it's because there is no clear target name in this case...
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Wouldn't it better to return long file name in such case? As I see, %D returns long names for e.g. files in archives (i.e. in case when there is no short name available).
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

so it's because there is no clear target name in this case..
No, c2 also shows focused file instead of selected files if selected filename is for example left.txt - a unique 8.3 DOS name.(not a ~name) - in this case the target name should be evident.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This should be fixed in TC 9.20 beta 1, please test it!

Note:When there is no file selected in the active panel, or just one, then %C1 will always contain the full path to the LEFT file, and %C1 the full path to the RIGHT file, even when the right panel is active. That's because it mimics the bahaviour of "Compare by content".
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Confirmed fixed in TC 9.20b1 :-)
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Fixed, thanks!
Post Reply