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 image preview flicker for load command #1335

Merged
merged 1 commit into from
Jul 11, 2023
Merged

Prevent image preview flicker for load command #1335

merged 1 commit into from
Jul 11, 2023

Conversation

joelim-work
Copy link
Collaborator

This is a continuation from the discussion in #1281. In my opinion the load command should not refresh the image preview, but only check whether files/directories have been modified. In the case that there are modifications, the image preview will be refreshed through calling the nav.checkDir and nav.checkReg functions. This is the same as how the period timer behaves, and is also implied by the documentation:

lf/doc.go

Lines 823 to 829 in 2f3c170

period int (default 0)
Set the interval in seconds for periodic checks of directory updates.
This works by periodically calling the 'load' command.
Note that directories are already updated automatically in many cases.
This option can be useful when there is an external process changing the displayed directory and you are not doing anything in lf.
Periodic checks are disabled when the value of this option is set to zero.

I understand the load command is used internally after updates such as rename, delete and paste, but in each case there will be modifications to the filesystem so the image preview will be refreshed anyway as described above. For me this works fine, but I suppose it would be nice if others test it as well, preferably with image previews.

@tex
Copy link

tex commented Jul 6, 2023

Tested it, works like a charm!

@joelim-work joelim-work merged commit a3127a2 into gokcehan:master Jul 11, 2023
@joelim-work joelim-work deleted the load-non-volatile branch July 11, 2023 22:54
@gokcehan gokcehan mentioned this pull request Sep 17, 2023
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.

custom on-select triggers file preview twice
3 participants