Closed tex closed 1 year ago
Thanks, I managed to reproduce the issue. The problem is that after a %
command finishes, it triggers a load
command which ends up refreshing the image preview: https://github.com/gokcehan/lf/blob/dc2627de23647b0a0d1fa13d4c039ac075db175c/app.go#L587
This is the implementation of the load
command: https://github.com/gokcehan/lf/blob/dc2627de23647b0a0d1fa13d4c039ac075db175c/eval.go#L1755-L1760
Note that the true
argument for app.ui.loadFile
means 'volatile' which will cause the image preview to refresh. I'm very tempted to change this to false
, but the load
command is used in other places and I'm not sure whether it will break something. At the very least the load
following a %
command should be non-volatile in my opinion, this has actually been discussed previously in https://github.com/gokcehan/lf/pull/1281#issuecomment-1575444672.
That makes sense.
If % command wants to refresh it can issue lf -remote "reload/redraw"...
In my opinion load
should still be called after a %
command, since it can theoretically do anything, including making changes to files. However it shouldn't refresh image previews unless there has been such a change. Anyway I have submitted a PR #1335, you are welcome to try it out and see if it works for you.
This works for me, tested it and all is perfect.
I have this in lfrc
and I am using kitty to preview images, movies, ...
When I have on-select enabled, then lf shows image preview twice. It causes not pleasant flickering. Wehn I disable this on-select, then lf shows image preview only once as it should.