TC7rc4 - Compare By Content, restore selection after saving

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
white
Power Member
Power Member
Posts: 5784
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

TC7rc4 - Compare By Content, restore selection after saving

Post by *white »

  • Select two files and open the Compare contents dialog (menu Files/Compare By Content).
  • Edit the contents of a file (actually change something).
  • Save the file.
  • Close the Compare By Content dialog.
  • The selection of the two files is gone. Why? (When nothing is changed the selection is not gone.)
  • Restore selection (menu Mark/Restore selection).
Which files are selected?

(Answer: files that were selected even before the two compared files were selected)
User avatar
eugensyl
Power Member
Power Member
Posts: 564
Joined: 2004-06-03, 18:27 UTC
Location: România
Contact:

Re: TC7rc4 - Compare By Content, restore selection after sav

Post by *eugensyl »

white wrote:
  • Select two files and open the Compare contents dialog (menu Files/Compare By Content).
  • Edit the contents of a file (actually change something).
  • Save the file.
  • Close the Compare By Content dialog.
  • The selection of the two files is gone. Why? (When nothing is changed the selection is not gone.)
  • Restore selection (menu Mark/Restore selection).
Which files are selected?

(Answer: files that were selected even before the two compared files were selected)

I think it's not a good idea to keep the last two files selected after one of them are edited. Can be dangerous. You can test functionality with edited file, without exit. Just save.
If you want, continue editing after the button "compare" (from left-up corner) is pressed.

Now is an other ask: I want to keep the last cursor position!

If you wrote about selected files for "compare by content" in same panel, I agree your point of view about the last "restore" selection, but files must still remain unselected after exit from 'Compare by content'.

Anyway, first look is between two files with the same name and often it's not necessary to select the files into opposite panel.


Best wishes,
My Best Wishes,

Eugen
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Total Commander refreshes the file list when a file has changed in a directory. If the list has changed, then the selection is removed to avoid problems with changed files. This is by design.
Author of Total Commander
https://www.ghisler.com
User avatar
white
Power Member
Power Member
Posts: 5784
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ghisler(Author) wrote:Total Commander refreshes the file list when a file has changed in a directory. If the list has changed, then the selection is removed to avoid problems with changed files. This is by design.
This thread is mainly about the selection not being restored correctly (see subject). Can you confirm this is a bug?
Consider the folowing case:
  1. Three files exist in a folder. The are named "Test1", "Test1.bak" and "Test2".
  2. Start TC (default configuration) and go to the folder mentioned above.
  3. Delete "Test1.bak".
  4. Select both "Test1" and "Test2".
  5. Open the Compare contents dialog (menu Files/Compare By Content).
  6. Edit "Test1" and save the changes (the original file is saved as "Test1.bak").
  7. Close the Compare contents dialog.
  8. Restore the selection. "Test1.bak" is selected. I would expect "Test1" and "Test2" to be selected.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Restore the selection. "Test1.bak" is selected. I would expect "Test1" and "Test2" to be selected.
Well, the selection isn't saved because "Compare" isn't really a file operation, so you cannot use restore here.
Author of Total Commander
https://www.ghisler.com
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

ghisler(Author) wrote:Well, the selection isn't saved because "Compare" isn't really a file operation, so you cannot use restore here.
"Edit" (as newly included in Compare function) in contrast is a file operation, don't you think so?
So I think saving the selection would be useful here, too.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
Post Reply