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

Jump to the nearest neighbor in the list in case some items disappeared #109

Closed
dumblob opened this issue Aug 26, 2018 · 1 comment
Closed

Comments

@dumblob
Copy link

dumblob commented Aug 26, 2018

Steps to reproduce:
a) open a directory D with several files/dirs
b) put the cursor to a file/dir of your choice
c) delete this file/dir and some others in this directory D at the same time (e.g. from a command line)
d) the listing refreshes and puts the cursor to the very first file

Intuitively though (especially for larger number of items in a directory) one would expect lf in the step (4) to put the cursor to the nearest item to the item which was originally focused, but disappeared. This is especially useful when deleting files directly in lf using a key stroke.

gokcehan added a commit that referenced this issue Aug 29, 2018
gokcehan added a commit that referenced this issue Aug 29, 2018
@gokcehan
Copy link
Owner

@dumblob I thought this was already working but I think I was confusing this with something else.

I have pushed a commit to keep the old cached index for selection as a fallback. This only works for the behavior of load but not for reload. Since cache is cleared on reload, it is difficult to implement this if not impossible. But we are using load internally whereever possible, so this should not become much of an issue.

As an exception, apparently shell-pipe was triggering reload after the command. This was not intentional, so I chanced it back to load.

Closing this issue now. Thanks for reporting.

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

No branches or pull requests

2 participants