Page 1 of 1

File list not updating properly when using multiple internal commands involving tabs quickly.

Posted: 2020-04-12, 13:45 UTC
by vort3
Here is my custom command:

Code: Select all

[em_OpenDirInNewTabOtherAndSwitch]
button=wcmicons.dll
cmd=cm_OpenDirInNewTabOther, cm_FocusTrg, cm_SwitchToNextTab, CM_WAIT 200, cm_FocusTrg
It tries to open directory under cursor in other panel in a new tab, switch to it (so it's in the foreground of the target panel) and then switch to original panel. Notice the CM_WAIT 200: it artificially slows down the execution of my command by adding delay after switching to new tab. Without the delay, my command fails. With CM_WAIT 200 it mostly works, but sometimes still fails. Using CM_WAIT 500 will always work but it slows down my speed too much.

UPD: With TabSwitchMode=1 this bug doesn't happen even without added delay, it only occurs when panels update after Tab release (TabSwitchMode=1).

Steps to reproduce:
[*] Add em_OpenDirInNewTabOtherAndSwitch (code above) to your usercmd.ini
[*] Open C:\ in your left panel and D:\ in right panel.
[*] Put your cursor in left panel to any folder, like Users folder.
[*] Execute em_OpenDirInNewTabOtherAndSwitch with a hotkey or button, or in any other way.

Expected behaviour:
[*] Left panel remains active with your cursor still on Users folder, but on the right panel there's a new foreground tab with C:\Users folder opened.

Actual result:
[*] Left panel remains active with your cursor still on Users folder, on the right panel there's a new foreground tab named Users, but file list and current path are not updated to reflect the new tab (still showing D:\ as was initially).
[*] In fact, even if you Reread the source, file list will still show D:\ and tab name will change back (I was expecting that after rereading the source file list and current path will update to C:\Users, because it's in the tab name).

If you can't reproduce it by following steps above, try to remove CM_WAIT 200 from the em_OpenDirInNewTabOtherAndSwitch command or change the delay to slammer value.

Using TC 9.51 (64 bit) on Windows 10 x64 LTSC (1809).

Re: File list not updating properly when using multiple internal commands involving tabs quickly.

Posted: 2020-04-12, 15:30 UTC
by petermad
I cannot reproduce this, even when omitting the cm_Wait command. I have testet it under Windows 7 and Windows 10 1909, and my Windows 10 computer is really slow, but still I cannot reproduce it.

But you don't need to do it this way - just enable "Configuration" -> "Options..." -> "Folder Tabs" -> "Ctrl+Up opens new tab in foreground".
This setting works for Ctrl+Shift+Up (= cm_OpenDirInNewTabOther) as well.

Re: File list not updating properly when using multiple internal commands involving tabs quickly.

Posted: 2020-04-12, 19:59 UTC
by vort3
petermad wrote: 2020-04-12, 15:30 UTC But you don't need to do it this way - just enable "Configuration" -> "Options..." -> "Folder Tabs" -> "Ctrl+Up opens new tab in foreground".
This setting works for Ctrl+Shift+Up (= cm_OpenDirInNewTabOther) as well.
The problem with this is that I want Ctrl+Up to open tabs in background (in current panel), but on the second panel I want them to be in foreground.

I can probably just change this setting and then rebind Ctrl+Up as I need, will try this now.

Also, can you please tell me if you have TabSwitchMode=1? I think it's 0 by default (and I quite like that), but maybe TabSwitchMode=1 would solve the problem for me, I'll try that now.

UPD: With TabSwitchMode=1 this bug doesn't happen, it only occurs when panels update after Tab release.

Re: File list not updating properly when using multiple internal commands involving tabs quickly.

Posted: 2020-04-13, 11:06 UTC
by petermad
Here it works equally good with have TabSwitchMode=0 and TabSwitchMode=1 (I use TabSwitchMode=0 as standard).

Maybe it is another setting - how does it work for you with a clean ini file (i.e. TabSwitchMode=0 and DirTabOptions=824 (Ctrl+Up disabled))?

Re: File list not updating properly when using multiple internal commands involving tabs quickly.

Posted: 2020-04-13, 13:54 UTC
by vort3
I tried to set DirTabOptions=824 and everything worked. I'm not sure what exactly is causing the bug, though. Do you have any idea?

I have DirTabOptions=2043, can you try this?

Re: File list not updating properly when using multiple internal commands involving tabs quickly.

Posted: 2020-04-13, 18:16 UTC
by petermad
With DirTabOptions=2043 the tab is opened in the background using your em_OpenDirInNewTabOtherAndSwitch command, wich is to be expected, since the "Ctrl+Up opens new tab in foreground" option is enabled with DirTabOptions=2043. The content of the opened tab is correct.

Re: File list not updating properly when using multiple internal commands involving tabs quickly.

Posted: 2020-04-13, 19:12 UTC
by vort3
Oops, my fault, I forgot that I already changed my settings (Ctrl+Up opens new tab in foreground, and now I use custom command to open dirs in new background folder instead).
Did you try it with "Ctrl+Up" opens new tab in foreground disabled, but everything else as if 2043? (1979)

Re: File list not updating properly when using multiple internal commands involving tabs quickly.

Posted: 2020-04-13, 19:16 UTC
by petermad
Did you try it with "Ctrl+Up" opens new tab in foreground disabled, but everything else as if 2043? (1979)
Yes - that too - no problems.

You have to test with a clean ini file except for DirTabOptions=1979 - maybe there is a completely other setting giving you your problems

Re: File list not updating properly when using multiple internal commands involving tabs quickly.

Posted: 2020-04-14, 15:21 UTC
by vort3
Maybe it has to do with hardware, and my laptop is just too slow to do commands as fast.