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

Prevent scrolling to bottom when selecting files #1222

Merged
merged 2 commits into from
May 13, 2023
Merged

Prevent scrolling to bottom when selecting files #1222

merged 2 commits into from
May 13, 2023

Conversation

joelim-work
Copy link
Collaborator

cc #1193

When selecting a file using either the mouse or the select command, the cursor scrolls to the bottom as a result of calling the dir.sel function.

I don't think it's a good idea to change how the scrolling works for dir.sel - it's useful for forcibly setting the position of the cursor (to the bottom) without taking into account of it's original position (this prevents the cursor from ending up out of bounds if the number of files changes, e.g. by applying a filter). Instead, the code for selecting a file is changed to use nav.move to achieve smoother scrolling similar to #1196.

@gokcehan
Copy link
Owner

@joelim-work Looks good, thanks for the patch.

@gokcehan gokcehan merged commit 35990be into gokcehan:master May 13, 2023
@joelim-work joelim-work deleted the smooth-select branch May 14, 2023 01:43
@halshar
Copy link

halshar commented May 27, 2023

is this the fix where selecting any file(using spacebar) causes the cursor to move down?

@joelim-work
Copy link
Collaborator Author

is this the fix where selecting any file(using spacebar) causes the cursor to move down?

@ryouiki-tenkai No, this is about the cursor jumping down to the bottom of the screen when using the select command or mouse click to focus on a file.

The select using spacebar you're referring to is the toggle command, which is different. By default, the spacebar is mapped to toggle the file, and in addition move the cursor down for convenience. If you want spacebar to just toggle the file then you can add map <space> toggle to your config file.

@halshar
Copy link

halshar commented May 28, 2023

@joelim-work thank you, this is what i needed :)

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

Successfully merging this pull request may close these issues.

3 participants