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

Wrong preview when current selection is a directory symlink. #25

Closed
occivink opened this issue Oct 4, 2016 · 5 comments
Closed

Wrong preview when current selection is a directory symlink. #25

occivink opened this issue Oct 4, 2016 · 5 comments
Labels

Comments

@occivink
Copy link
Contributor

occivink commented Oct 4, 2016

I swear I don't have that many symlinks.

Anyway, when the current selection is on a directory symlink, it will display in the preview pane the content of the last previewed directory.

Example:

$ tree
.
├── bar/
│   ├── bar1
│   ├── bar2
│   └── bar3
├── foo/
│   ├── foo1
│   ├── foo2
│   └── foo3
└── zab -> /home/occivink/tmp/bar/

If you start lf in such a directory and press down twice, it will show

foo1
foo2
foo3

in the preview pane. If you then go left and right, it will show

bar
foo
zab

You get the idea.

@gokcehan
Copy link
Owner

gokcehan commented Oct 4, 2016

Thanks for the detailed bug report @occivink . This is likely the same issue as #24. It seems that lf does not preview links to directories. Previews are buffered for performance reason and since it doesn't update correctly it shows you the previous content. Also since they are not initialized it crashes when the first selection is a link to a directory. Probably a simple issue but it sounds quite annoying. I will try to push a fix as soon as possible, hopefully before tomorrow. Meanwhile if anyone wants to handle this, maybe also initialize the buffers somehow so things won't be so fragile.

@occivink
Copy link
Contributor Author

occivink commented Oct 4, 2016

Ah yes that makes sense, I can't believe I didn't make the link between the two cases.

@KenjiTakahashi
Copy link
Contributor

I guess this is somewhat related to #20 as well. This broke after the buffering thing, right? I remember it working in the past.

@gokcehan
Copy link
Owner

gokcehan commented Oct 4, 2016

Yes, I think so @KenjiTakahashi

gokcehan added a commit that referenced this issue Oct 5, 2016
@gokcehan
Copy link
Owner

gokcehan commented Oct 7, 2016

@occivink With the latest commit we're handling the directory symlinks correctly. Closing this issue now. Feel free to open again if you have any more problems after you update to the latest version.

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

No branches or pull requests

3 participants