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

feature request: Do not redraw screen screen between preview #990

Closed
sucrecacao opened this issue Nov 5, 2022 · 4 comments
Closed

feature request: Do not redraw screen screen between preview #990

sucrecacao opened this issue Nov 5, 2022 · 4 comments

Comments

@sucrecacao
Copy link

Hi,

between two preview lf redraw the screen with a 'loading...' message.

Even by commenting ui.go line 266, lf will still redraw a blank window.

This create an annoying flickering effets, as mentioned in previous issues.

Where and how can I hack lf so it doesn't redraw the screen between preview?

@joelim-work
Copy link
Collaborator

Since #1154, lf will now wait 100 milliseconds before displaying a loading... message, which should generally be enough time for an image preview to be displayed,

When navigating to a new file, the cleaner script will be run immediately - if you want to retain the previous image, you can add some logic in the cleaner script to skip clearing if the next file is also an image, see the discussion in #626 for more details.

@joelim-work
Copy link
Collaborator

@asklow I'm not sure if I understand your comment, but the 100ms affects only how long it takes for the loading... message to be displayed. It has no effect on image preview itself - during the time it takes to load the new preview, the decision of whether to retain the previous image or clear it immediately is determined by your cleaner script.

Also, the tcell library doesn't support distinguishing between key press and key release events, according to the documentation:

EventKey represents a key press. Usually this is a key press followed by a key release, but since terminal programs don't have a way to report key release events, we usually get just one event. If a key is held down then the terminal may synthesize repeated key presses at some predefined rate. We have no control over that, nor visibility into it.

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
@joelim-work @sucrecacao and others