Wrong line position when returning from sub folder

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
TimoJ
Junior Member
Junior Member
Posts: 17
Joined: 2016-09-03, 14:13 UTC

Wrong line position when returning from sub folder

Post by *TimoJ »

With a folder containing lots of sub-folders, when returning to parent folder the subfolder and cursor are positioned on the fourth row from the bottom instead of the line position where they were before entering the sub folder.

The problem is talked about in this thread with a video showing the problem:
https://www.ghisler.ch/board/viewtopic.php?f=3&t=36924
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48075
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wrong line position when returning from sub folder

Post by *ghisler(Author) »

The line position isn't restored to some older position when going up one level. The reason is that there are many ways how you could have gone there, including directory hotlist (bookmarks), button bar, and start menu, where the parent directory wasn't even involved. TC only remembers the last active position in the history, so you can use that to go back.
Author of Total Commander
https://www.ghisler.com
TimoJ
Junior Member
Junior Member
Posts: 17
Joined: 2016-09-03, 14:13 UTC

Re: Wrong line position when returning from sub folder

Post by *TimoJ »

But why does it go to the 4th row from the bottom? Then again, it's not always the 4th bottom row, sometimes it's just few lines lower of the correct position. Depends what row you were before entering the subfolder.

I'm using keyboard to navigate and I find it weird when I press backspace and the lines and cursor jumps down instead of the position where they were before. This only happens in a folder with lots of subfolders. I think in this case the correct previous list position should be restored. Bookmarks, button bar, start menu etc. are a different case.
User avatar
AntonyD
Power Member
Power Member
Posts: 1246
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Wrong line position when returning from sub folder

Post by *AntonyD »

2ghisler(Author)
no, there is something strange obviously...
I completely agree with TS=TimoJ - that in this bug we are talking about the keyboard(mouse) navigation initially. And this BUG obviously a BUG - because in any another available realization of a dir listing in a form of the FilePanel - which I previously have used (some another file managers - real, mature SW or an odd job on the basis of some kind of framework) - If I scrolled some record with dirName to position 12 for example (counting from the top of this file panel) after commands sequence: Enter into the selected dirName -> Went back from processed dirName: I always returned back on the 12 position in the file panel... Probably we again should talk about the internal bug of Lazarus|Delphi components...

So,
ghisler(Author) pls, pay attention as it only possible on this bug for the keyboard(mouse) navigation as the start point. This position in FilePanel must be saved and restored accurately.

PS. for a quick example of "proper" behavior - look at FreeCommander
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48075
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Wrong line position when returning from sub folder

Post by *ghisler(Author) »

But why does it go to the 4th row from the bottom?
It scrolls the directory from which you came into view, and leaves some extra lines below it so you can see what comes next.
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 1246
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: Wrong line position when returning from sub folder

Post by *AntonyD »

ghisler(Author) wrote: 2019-12-23, 15:10 UTC
But why does it go to the 4th row from the bottom?
It scrolls the directory from which you came into view, and leaves some extra lines below it so you can see what comes next.
but code should not do that! it must restore the original place of cursor/selected record/
As i said -pls take a look into FreeCommander behavior. Open C:\Windows folder, scroll a little bit, select some folder near to the bottom of the list, Remember visually all the positions of notable items in the list at FilePane, open this selected dir, now come back to C:\Windows - and take a look at the cursor position/selection of the record with dir in the list and all other notable items: it all will not change!
#146217 personal license
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Wrong line position when returning from sub folder

Post by *Stefan2 »

AntonDudarenko wrote: 2019-12-23, 17:06 UTC
ghisler(Author) wrote: 2019-12-23, 15:10 UTC
But why does it go to the 4th row from the bottom?
It scrolls the directory from which you came into view, and leaves some extra lines below it so you can see what comes next.
but code should not do that!

08.07.19 Added: New configuration option shown in
Configuration - Options - Operation: Extra lines below cursor.
Sets both ScrollingTopMargin and ScrollingBottomMargin (32/64)


That :?:




 
 
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6480
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Wrong line position when returning from sub folder

Post by *Horst.Epp »

Stefan2 wrote: 2019-12-23, 18:26 UTC
AntonDudarenko wrote: 2019-12-23, 17:06 UTC
ghisler(Author) wrote: 2019-12-23, 15:10 UTC
It scrolls the directory from which you came into view, and leaves some extra lines below it so you can see what comes next.
but code should not do that!

08.07.19 Added: New configuration option shown in
Configuration - Options - Operation: Extra lines below cursor.
Sets both ScrollingTopMargin and ScrollingBottomMargin (32/64)


That :?:
This option doesn't help and is not responsible for the wrong behaviour.
Free Commander, Double Commander and Unreal Commander are examples how TC should work.
They restore the exact screen positions.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Re: Wrong line position when returning from sub folder

Post by *tuska »

Stefan2 wrote: 2019-12-23, 18:26 UTC That :?:
Maybe in some way.

I switched off "Extra lines below cursor: 4" in TC.
With a click of the mouse on [..] <DIR> I can confirm the behavior described above.

With ALT+left arrow one can switch back to the folder, e.g. C:\Windows at exactly the same position (!),
cursor position on the folder, e.g. "Resources".

Perhaps the behavior when clicking on [..] <DIR> with the mouse button
can be adjusted to the behavior of ALT+left arrow.


Windows 10 Pro (x64) Version 1909 (OS build 18363.535), TC 9.50ß10 x64/x86
User avatar
tuska
Power Member
Power Member
Posts: 3755
Joined: 2007-05-21, 12:17 UTC

Re: Wrong line position when returning from sub folder

Post by *tuska »

ghisler(Author) wrote: 2019-12-23, 15:10 UTC
But why does it go to the 4th row from the bottom?
It scrolls the directory from which you came into view, and leaves some extra lines below it so you can see what comes next.
No, this is not the case here --> Picture.

The image shows that what comes next will be hidden(!).
Rather, a review is displayed.

Please change this behavior (with mouse clicks).


This function with the 4 lines is a mystery to me anyway - example (mouse clicks):
- If you click on one of the last four folders on the 1st screen page and then switch back again,
  then further folders are displayed --> OK.
- If you move the slider only half a screen page down, i.e. position at 1 1/2 screen pages,
  then after returning, the current folder is moved down to the fourth last position (as in the picture above).
- even if I am on the last page of the screen (scroll bar at the very bottom) and change into the seventh last folder,
  then when you return, this folder will be displayed at the fourth last position and three folders will be hidden.
Post Reply