8000 Exhaust queued entries in previewChan prior to calling preview script by neeshy · Pull Request #562 · gokcehan/lf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Exhaust queued entries in previewChan prior to calling preview script #562

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

Merged
merged 2 commits into from
Jan 19, 2021
Merged

Conversation

neeshy
Copy link
Contributor
@neeshy neeshy commented Jan 18, 2021

I've noticed that ever since #546 when rapidly moving between a large amount of files, the previewLoop thread can take a while to catch up to the currently selected file. It will try to clear and preview every file. It becomes especially apparent when previewing files over the network. This PR fixes that by avoiding redundant calls to the preview script. I've added logic to consume all available values in previewChan before a call to either the previewer or cleaner is made. Also, if "" is sent over the channel immediately before a valid path, previewLoop will still call the cleaner script and then the previewer script, just like before.

@gokcehan
Copy link
Owner

@neeshy This is much better thank you.

In the meantime I have been trying to get rid of redundant preview calls in movement commands when they don't change the current file. Hopefully I have not broken anything. It is possible to do this in find/search commands as well, but they are more complicated so maybe it's not worth for now.

In general, image previews seem to be stable enough as we are not getting any issue reports about it. I think I might tag a new release soon so more people can give it a try.

@gokcehan gokcehan merged commit 3f66f08 into gokcehan:master Jan 19, 2021
@neeshy
Copy link
Contributor Author
neeshy commented Jan 19, 2021

Excellent! Thanks.

gokcehan pushed a commit that referenced this pull request Jan 20, 2021
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.

2 participants
0