Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse navigation is unintuitive in 2 ways. #1193

Open
oredaze opened this issue Apr 3, 2023 · 4 comments
Open

Mouse navigation is unintuitive in 2 ways. #1193

oredaze opened this issue Apr 3, 2023 · 4 comments

Comments

@oredaze
Copy link

oredaze commented Apr 3, 2023

  1. When selecting an item in the second column, instead of the selection simply moving to that item, it moves to the item and the item scrolls to the bottom of the screen, resulting in disorienting jump. Weird. Almost feels like a bug. Of course if the selected item can't move to the bottom (all items fit on screen or screen is scrolled to top) it behaves normally.

  2. The behavior of left/right click is reversed between the first and second column. The second column behaves properly: left click selects, right click enters in the directory such that the columns shift leftwards. One thus would expect that when clicking on the first column, left click would select and right click would enter back, shifting the columns towards the right. But no. Mouse buttons on 1st column are not like that, they are reversed.

@p-ouellette
Copy link
Contributor

  1. Yes this is a bug. The problem seems to be here:

    lf/nav.go

    Line 348 in 83af3e1

    dir.pos = min(dir.ind, height-edge-1)

    This also affects other commands that call dir.sel e.g. :select and :rename.

  2. This behavior is copied from ranger. The same issue was raised there: Mouse buttons are inconsistent between the columns ranger/ranger#2378. I can see how it might be unintuitive, but I'm not sure that the alternative would make any more sense. The way to think about it is left click = select, right click = open (and note that the selected/current file is the one in the middle column).

@oredaze
Copy link
Author

oredaze commented Apr 4, 2023

I understand how the logic can be viewed this way, but my brain refuses to obey. I think the problem is that one of the buttons produces shifting of the columns, while the other does not. It would be nice if that button is one and the same.
Of course it doesn't need to be the only option, not a default, but I doubt it's a lot of work.
Thanks for the consideration either way.

@joelim-work
Copy link
Collaborator

Regarding the first point, I think dir.sel shouldn't take the current cursor position into account and unconditionally select some fixed location (like the bottom file) in case the number of files changes (e.g. by applying a filter). Anyway I submitted a pull request to prevent the scrolling when clicking on a file, this is achieved by having select use a different method other than calling dir.sel.

@oredaze
Copy link
Author

oredaze commented Jun 5, 2023

First point has been fixed in r30.
If the second point is not recognized as useful, feel free to close he issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants