cm_rereadsource & Selected files

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

Moderators: white, Hacker, petermad, Stefan2

Galizza
Member
Member
Posts: 167
Joined: 2018-09-07, 05:21 UTC

cm_rereadsource & Selected files

Post by *Galizza »

 
Hi, if i use cm_rereadsource on a panel with several files selected Tc don't
unmark them, but when i use cm_rereadsource 1 then selected files are
unmarked, may you consider a new option like cm_rereadsource 4
that force a refresh but without unmarking any file ?, thanks
 
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: cm_rereadsource & Selected files

Post by *Fla$her »

What is important, the selection is not only reset, but also not restored. A bug?

Code: Select all

cm_RereadSource 1,cm_RestoreSelection
Overquoting is evil! 👎
sa16
Senior Member
Senior Member
Posts: 215
Joined: 2021-09-10, 07:15 UTC

Re: cm_rereadsource & Selected files

Post by *sa16 »

2Galizza
You can do this: cm_SaveSelection,cm_RereadSource 1,cm_RestoreSelection.
Galizza
Member
Member
Posts: 167
Joined: 2018-09-07, 05:21 UTC

Re: cm_rereadsource & Selected files

Post by *Galizza »

sa16 wrote: 2022-09-15, 16:33 UTC You can do this: cm_SaveSelection,cm_RereadSource 1,cm_RestoreSelection.
Thank you

2Fla$her
Let's see if is it considered as a bug, thanks
User avatar
white
Power Member
Power Member
Posts: 4595
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: cm_rereadsource & Selected files

Post by *white »

Galizza wrote: 2022-09-15, 14:33 UTC Hi, if i use cm_rereadsource on a panel with several files selected Tc don't unmark them..
Then TC detected nothing had changed in that folder and didn't do a refresh.
Galizza wrote: 2022-09-15, 14:33 UTC ..but when i use cm_rereadsource 1 then selected files are unmarked
In this case you forced a refresh and the selected files are unmarked.
Fla$her wrote: 2022-09-15, 16:00 UTC What is important, the selection is not only reset, but also not restored. A bug?

Code: Select all

cm_RereadSource 1,cm_RestoreSelection
Yes, I believe there is one.
Apparently Auto-Refresh when activating the program does save the selection, but a manual refresh doesn't save the selection.
  • Mark files 1, 2 and 3
  • Press CTRL+NUM - (deselect all) (selection is stored implicitly)
  • Mark files 4, 5 and 6
  • Execute cm_RereadSource 1
  • Press NUM / (restore selection)
Now files 1, 2 and 3 are marked.
If you can't restore the last selection after a refresh, it's weird for the user that an earlier selection is restored instead.

Auto-Refresh when the file system changes - Selection is not lost.
Auto-Refresh when activating the program - Selection is lost but saved.
Manual Refresh - Selection is lost and not saved.

Moderator message from: white » 2022-09-16, 09:44 UTC

Moved to bugs forum.
User avatar
petermad
Power Member
Power Member
Posts: 14740
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_rereadsource & Selected files

Post by *petermad »

2white
Press CTRL+NUM - (deselect all) (selection is stored implicitly)
This is a false assumption, the selection is only saved if some sort of action takes place that clears the list. Such an action could be pressing Ctrl+NUM - (but not pressing NUM- -> * -> Enter (cm_ShrinkSelection) for some reason).

Try and replace Execute cm_RereadSource 1 in your example above with: cm_ShrinkSelection - same outcome.
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
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: cm_rereadsource & Selected files

Post by *Fla$her »

2ghisler(Author)
What is the reason for moving the topic? It would be logical to fix it.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: cm_rereadsource & Selected files

Post by *ghisler(Author) »

cm_rereadsource does nothing if it detects that the folder wasn't changed. Therefore the selection is preserved. However, if something changes, or you force a refresh via cm_rereadsource 1, then the current file list is removed and replaced by the new one read by cm_rereadsource. This also removes the current selection.
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: cm_rereadsource & Selected files

Post by *Fla$her »

ghisler(Author) wrote: 2022-10-03, 08:03 UTCthen the current file list is removed and replaced by the new one read by cm_rereadsource.
Where does he get this new list from? And why did you need to do this? What's the point of deleting a list from memory?
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: cm_rereadsource & Selected files

Post by *ghisler(Author) »

cm_rereadsource reads the file list of the current directory, then checks if its checksum is the same as that of the currently displayed list. If they are the same, the displayed list isn't refreshed to avoid flickering. If they not the same, the old list is discarded and the new one is shown.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 4595
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: cm_rereadsource & Selected files

Post by *white »

2ghisler(Author)
Please read the thread again. From second post onwards it's about not being able to restore the selection.
white wrote: 2022-09-16, 10:11 UTC Apparently Auto-Refresh when activating the program does save the selection, but a manual refresh doesn't save the selection.
  • Mark files 1, 2 and 3
  • Press CTRL+NUM - (deselect all) (selection is stored implicitly)
  • Mark files 4, 5 and 6
  • Execute cm_RereadSource 1
  • Press NUM / (restore selection)
Now files 1, 2 and 3 are marked.
If you can't restore the last selection after a refresh, it's weird for the user that an earlier selection is restored instead.

Auto-Refresh when the file system changes - Selection is not lost.
Auto-Refresh when activating the program - Selection is lost but saved.
Manual Refresh - Selection is lost and not saved.
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: cm_rereadsource & Selected files

Post by *Fla$her »

2ghisler(Author)
Yes, yes. It's not about resetting the list, but about what I wrote:
Fla$her wrote: 2022-09-15, 16:00 UTCWhat is important, the selection is not only reset, but also not restored.
Overquoting is evil! 👎
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: cm_rereadsource & Selected files

Post by *ghisler(Author) »

cm_RestoreSelection only works when the previous selection was stored, which only happens in file operations, e.g. when you copy something and the selection gets removed. That's why you have to call
cm_SaveSelection,cm_RereadSource 1,cm_RestoreSelection
Author of Total Commander
https://www.ghisler.com
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: cm_rereadsource & Selected files

Post by *Fla$her »

When we execute cm_RereadSource, the panel is redrawn, this can be seen by tabs. The selection is not lost.
If we remove the selection by Ctrl + [-], then we can easily return it by pressing [/].
Why does resetting the allocation by hotkey not delete the allocation list from memory, but the one called by cm_RereadSource 1 does? Why can't you get rid of it?
Overquoting is evil! 👎
User avatar
white
Power Member
Power Member
Posts: 4595
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: cm_rereadsource & Selected files

Post by *white »

ghisler(Author) wrote: 2022-10-04, 08:36 UTC cm_RestoreSelection only works when the previous selection was stored, which only happens in file operations, e.g. when you copy something and the selection gets removed.
Not true, as I just mentioned above:
white wrote: 2022-09-16, 10:11 UTC Press CTRL+NUM - (deselect all) (selection is stored implicitly)
white wrote: 2022-09-16, 10:11 UTC Auto-Refresh when activating the program - Selection is lost but saved.
It's like petermad says:
petermad wrote: 2022-09-17, 13:27 UTC .. the selection is only saved if some sort of action takes place that clears the list. Such an action could be pressing Ctrl+NUM -
Manual refresh is an exception causing confusing behavior:
white wrote: 2022-09-16, 10:11 UTC If you can't restore the last selection after a refresh, it's weird for the user that an earlier selection is restored instead.
Post Reply