Solved [TC9b11] Change in the way rules are handled

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

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Solved [TC9b11] Change in the way rules are handled

Post by *petermad »

TC9b10 and TC9b11 are not handling switching directory after setting a View mode manually in the same way.

To reproduce:

1. Set the following View modes/rules
[ViewModeSwitch]
Enabled=1
0_rules=+*\totalcmd\*\
0_mode=2
1_rules=L
1_mode=1

[ViewModes]
0_name=<Standard>
0_icon=%COMMANDER_EXE%,6
0_options=-1|-1|0||-1|-1|-1
1_name=Folder
1_icon=*%COMMANDER_EXE%,6
1_commands=*cm_SrcAllFiles
1_options=-1|-1|0||-1|-1|-1
2_name=Programs
2_icon=%COMMANDER_PATH%\wcmicons.dll,12
2_commands=cm_SrcExecs
2_options=-1|-1|0||-1|-1|-1
2. Make a folder c:\test
3. Open a folder tab and go to c:\test
4. Either Right-click on the folder tab and choose the "Programs" view mode or use "Show" -> "Custom View Modes" -> "Programs"
5: The Curent Directory bar now shows: c:\test\*.EXE;*COM;*BAT;*.CMD
6. Go to c:\
In TC9b10 the Curent Directory bar now - as expected - shows: c:\*.*
In TC9B11 the Curent Directory bar now unexpectedly still shows: c:\*.EXE;*COM;*BAT;*.CMD

This only happens in Folder tabs - not when there is no tabs
It works correctly if I replace step 4 with a press on Ctrl+F11.
If I switch step 3 and 4 it works correctly.

I guess it has to do vith:
23.08.16 Added: When user changes the view mode manually while automatic view mode switching is enabled, keep that view mode until the directory changes to a location with a different view mode rule>0 (32/64)
But that doesn't explain why it is handled differently with and without Folder tabs - and this might not always be desired behaviour - so maybe this should be made optional - or at least the asterisk in front of the internal command should be respected!
Last edited by petermad on 2021-05-30, 11:56 UTC, edited 2 times in total.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

One question. When you go to C: in step 6 do you expect to that the rule named 'L' matches?
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

One question. When you go to C: in step 6 do you expect to that the rule named 'L' matches?
Yes, and it did in TC9b10. I especially expect it because the mode has: 1_commands=*cm_SrcAllFiles

Also rule L should always cause a change unless any other rule higher on the list applies, which I don't see in this example.

The asterisk should secure it:
Put a * in front of the commands to run them on each directory change to and within that view mode.
Actually in TC9B10 it works even without the asterisk.

Also I find it inconsistant that the behaviour if different when in a Folder tab compared to a non-tabbed file panel.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2petermad
I can confirm the differing behavior your described for beta 10 and beta 11.

I don't see any connection to the change you quoted though. The change is about the behavior when no rule applies which isn't the case here.

Maybe the problem is related to the fact that the helps says regarding the L rule (translated back form German):
'One or more drive types can be set via editbox.' You entered none. Maybe this is handled differently in beta 10 and 11?
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Maybe the problem is related to the fact that the helps says regarding the L rule
I tried to use rules=L3 (Hardisk/SSD) in stead of rules=L - it doesn't make any difference.

I also tried with rules=L1|&L2|&L3|&L4|&L5|&L6 - no difference either.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50550
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2petermad
What you describe is not a bug, it is fully intentional:
23.08.16 Added: When user changes the view mode manually while automatic view mode switching is enabled, keep that view mode until the directory changes to a location with a different view mode rule>0 (32/64)
When you go from c:\test to c:\, the same rule Nr. 1 applies. Now when you change view mode manually while in c:\test, TC assumes that you want to use this mode as long as you don't enter a directory with a different rule. Since you go to c:\ from c:\temp, you are in the same rule area, so nothing will be changed.

To re-enabled automatic view mode changing, just set the previous mode.
Author of Total Commander
https://www.ghisler.com
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

When you go from c:\test to c:\, the same rule Nr. 1 applies. Now when you change view mode manually while in c:\test, TC assumes that you want to use this mode as long as you don't enter a directory with a different rule. Since you go to c:\ from c:\temp, you are in the same rule area, so nothing will be changed.
Thanks for the explanation. I didn't think of how extensive L actually is.
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2ghisler(Author)

I can appreciate that the view mode is not changed because the rule (L) still applies when going from c:\test to c:\ but what about the use of the asterisk in front of the command to run - Help says:
Put a * in front of the commands to run them on each directory change to and within that view mode.
The crucial word being within - in this case within the rule L - shouldn't the 1_commands=*cm_SrcAllFiles be executed in this case?

And still - why does it behave differently when not in a folder tab?
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50550
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

You changed manually from view mode 1 to view mode 2. Why should the commands from view mode 1 be executed when you are actually in view mode 2?
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

OK - and I see that you have changed TC9b12 so it at least works the same way with and without folder tabs. I consider it fixed now :-)
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50550
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, it was a bug without folder tabs, it was only stored in the tabs by mistake.
Author of Total Commander
https://www.ghisler.com
Post Reply