You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this while testing why the lfimg project has the issue where after you've previewed a media file, if you navigate to that file again, it doesn't draw its preview again. The reason is that lf doesn't ever call the user's previewer script after it has called it for a file once during the lf session.
Steps to reproduce
Add echo "previewing $1" >> /tmp/testing.log to your previewer script so it is called on every file that is previewed
Run tail --follow /tmp/testing.log to watch the file as it updates
Open lf in a directory with files to be previewed, and navigate to each file. You'll see output in testing.log for each file.
Now, navigate back up to the files you already previewed.
What you'll see is that although lf is able to preview the text files, it never calls the previewer script again (you can tell because your tail command won't give any more output), so if you're using lfimg to preview media, they won't be drawn again. lf seems to be caching the text previews for files, and displaying the cached version rather than calling the previewer script each time.
Basically, the media file previews in the lfimg project would work perfectly if lf was changed to always call the previewer script every time, and stop doing caching. Is there a way to give the user control over this so we can get media previews working better? For reference, this is what I'm referring to: https://github.com/cirala/lfimg
The text was updated successfully, but these errors were encountered:
I looked into it and as mentioned on #522, lfp (https://gitlab.com/Provessor/lfp) already implements this desired behavior. As long as the preview script returns a non-zero exit code the given file's preview will be regenerated the next time it is selected.
I noticed this while testing why the lfimg project has the issue where after you've previewed a media file, if you navigate to that file again, it doesn't draw its preview again. The reason is that lf doesn't ever call the user's previewer script after it has called it for a file once during the lf session.
Steps to reproduce
echo "previewing $1" >> /tmp/testing.log
to your previewer script so it is called on every file that is previewedtail --follow /tmp/testing.log
to watch the file as it updatesWhat you'll see is that although lf is able to preview the text files, it never calls the previewer script again (you can tell because your
tail
command won't give any more output), so if you're using lfimg to preview media, they won't be drawn again. lf seems to be caching the text previews for files, and displaying the cached version rather than calling the previewer script each time.Basically, the media file previews in the lfimg project would work perfectly if lf was changed to always call the previewer script every time, and stop doing caching. Is there a way to give the user control over this so we can get media previews working better? For reference, this is what I'm referring to: https://github.com/cirala/lfimg
The text was updated successfully, but these errors were encountered: