Branch view and cursor position

Here you can propose new features, make suggestions etc.

Moderators: sheep, Hacker, Stefan2, white

Post Reply
User avatar
Vochomurka
Power Member
Power Member
Posts: 790
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Branch view and cursor position

Post by *Vochomurka » 2019-07-07, 11:42 UTC

Suppose there is the following directory structure:

Code: Select all

Folder1
   Folder2
      File1
   File2
File3
When the branch view is switched on, the panel shows:

Code: Select all

File1
File2
File3
The status bar shows (respectively):

Code: Select all

Folder1\Folder2\File1
Folder1\File2
File3
When user puts the cursor on some file, and then executes the cm_RereadSource (Ctrl+R or F2), or cm_DirBranch (Ctrl+B) command, that is, switches the branch view mode off, the cursor goes to:

Code: Select all

File1 -> Folder1
File2 -> File3
File3 -> File3
Do you see some logics in such behavior? I don't.
I suppose the following:
File1 -> File1
File2 -> File2
File3 -> File3
That is, cursor always is put exactly on the file where it was when the branch view mode is switched off.
The reason is: we usually use the branch view to find a file whose name we know (may be approximately) but whose path we don't. After finding the sought file, we like to go directly to this file
Single user license #329241
PowerPro scripts for Total Commander

User avatar
petermad
Power Member
Power Member
Posts: 8835
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Branch view and cursor position

Post by *petermad » 2019-07-07, 12:27 UTC

I can only reproduce this using Ctrl+R of F2 to leave branch view.

If I use Ctrl+B (or cm_DirBranch) it goes to the file under the cursor:
File1 -> File1
File2 -> File2
File3 -> File3

Testet with my every day ini file and with a fresh ini file.

The behaviour also changes (when using Ctrl+R and F2) depending on the name sorting - with reverse sort order or no sort order for name it always goest to file3 when pressing Ctrl+R or F2.

What TC actually does when you press F2 or Ctrl+R is that is goes to the parent folder, and if the file that the cursor was on when you pressed F2 does not exist in the parent folder, then TC tries to place the cursor on the same line number as it was on when you pressed F2 - but because - in your example - there are only two lines (folder1 and file3) in the parent folder, any file that was not on line 1 will be placed on line 2 (the highest line number).

If the line number the cursor is on, when pressing F2 is higher than the visible number of lines in the file panel, then TC jumps to the root line [..]

Try and put some more files in parent folder and folder1 - then you can see what I mean.
License #524 (1994)
Danish Total Commander Translator
TC 9.5b3 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1903) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

User avatar
Vochomurka
Power Member
Power Member
Posts: 790
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Re: Branch view and cursor position

Post by *Vochomurka » 2019-07-07, 14:35 UTC

petermad wrote:
2019-07-07, 12:27 UTC
I can only reproduce this using Ctrl+R of F2 to leave branch view.

If I use Ctrl+B (or cm_DirBranch) it goes to the file under the cursor:
File1 -> File1
File2 -> File2
File3 -> File3

Testet with my every day ini file and with a fresh ini file
Yes, I confirm that. Strange, but I tested the cm_DirBranch command. Now I will know that I should press Ctrl+B rather than Ctrl+R to go to the current file.
What TC actually does when you press F2 or Ctrl+R is that is goes to the parent folder
I don't find it reasonable.
does not exist
What do you mean? If it exists in branch view, it must exist in usual view, too!
I don't consider the case when the file is deleted by some third party app after the branch view is switched on, but before it is switched off. Such case is quite specific, isn't it?
TC tries to place the cursor on the same line number as it was on when you pressed F2
I don't find that reasonable, either.
If the line number the cursor is on, when pressing F2 is higher than the visible number of lines in the file panel, then TC jumps to the root line [..]
The same attitude.
Try and put some more files in parent folder and folder1 - then you can see what I mean
Yes, I can see it; but don't you think that the TC behaviour must be the same with no regard on how many files there are?
Anyway, thank you, petermad. I will not give the cm_RereadSource command in branch view anymore, as though it is an incorrect command!
Single user license #329241
PowerPro scripts for Total Commander

User avatar
petermad
Power Member
Power Member
Posts: 8835
Joined: 2003-02-05, 20:24 UTC
Location: Valsted, Denmark
Contact:

Re: Branch view and cursor position

Post by *petermad » 2019-07-07, 22:26 UTC

What do you mean? If it exists in branch view, it must exist in usual view, too!
If the cursor in branch view is on a file in a subfolder to the original folder, then when TC goes back to the original folder, that file will not be present there, hence TC cannot put the cursor on it.
License #524 (1994)
Danish Total Commander Translator
TC 9.5b3 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 (1903) 64bit, 'Everything' 1.4.1.935 (x64)
TC 3.0b12 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

Post Reply