Skip to content

fix: preview pane flicker#2537

Open
valoq wants to merge 3 commits intogokcehan:masterfrom
valoq:clear
Open

fix: preview pane flicker#2537
valoq wants to merge 3 commits intogokcehan:masterfrom
valoq:clear

Conversation

@valoq
Copy link
Copy Markdown
Contributor

@valoq valoq commented Apr 19, 2026

The preview pane is redrawn on vertical resize in tiling window managers like sway when opening a sibling window below the lf terminal window, causing a visual flicker in the preview pane only. This is the case when gui apps are opened by lf in vertical setups.

The patch addresses this by only dropping cached regs when the preview width actually changed

@valoq valoq changed the title fix preview pane flicker fix: preview pane flicker Apr 22, 2026
Copy link
Copy Markdown
Collaborator

@joelim-work joelim-work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previews are capped at the height of the preview window, so it effectively depends on the height as well. For example if the width is 10, then previews will contain at most 10 lines of text.

This change means that previews won't be updated if the height increases, leading to empty space in the preview window.

@valoq
Copy link
Copy Markdown
Contributor Author

valoq commented Apr 23, 2026

With the original PR, I was not able to trigger any issues when the height increases.
The latest commit now causes the preview to reload and flicker then the height increases.

Im not sure how to address this without a more complex solution, but I am wondering if we actually need b0d5923

@joelim-work do you have any example where the previous solution actually caused issues? I suspect it actually worked fine but I still have to find out why the height increase never triggered any issue. Both external and internal previews were reloaded on height changes.

@joelim-work
Copy link
Copy Markdown
Collaborator

do you have any example where the previous solution actually caused issues?

The issue happens using the default settings, just preview a text file and then increase the height window.

The current PR right now will keep previews if the window height decreases (lines > height), but the design still requires previews to be refreshed if the window height increases instead, so this is at best an optimization.

@valoq
Copy link
Copy Markdown
Contributor Author

valoq commented Apr 24, 2026

It looks like the issue did not trigger on tiling window manager but you are right.

another problem was that the height was updated even when the cache has the correct size, so going back and forth in height triggered a reload and flicker every time.

Now the patch checks the cache height instead

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