[vim/vim] fix: flickering on opaque popups for overlapping text (PR #19534)

11 views
Skip to first unread message

Javier Jaramago Fernández

unread,
Feb 28, 2026, 1:28:58 PM (2 days ago) Feb 28
to vim/vim, Subscribed

Description

A flickering effect was introduced in commit 6c20307 for all popups. This is a consequence of a double redraw of the overlapping background characters. This could be expected for transparent popups, but, it should exclude opaque ones. For a complete fix of the flickering this commit is required in combination with fix present in 97c5bed.

Reproduction

Sourcing this simple script with background text (this can be the script itself) reproduces the issue:

" scroll_popup.vim
" Continuously scrolling popup with multi-line content

let s:text = []
for i in range(1, 50)
	call add(s:text, printf("This is scrolling line %02d — Vim popup demo", i))
endfor

let s:firstline = 1
let s:popup_id = -1

function! s:scroll_popup(timer) abort
	let s:firstline += 1

	" Wrap when reaching the end
	if s:firstline > len(s:text)
		let s:firstline = 1
	endif

	call popup_setoptions(s:popup_id, {'firstline': s:firstline})
	call popup_move(s:popup_id, { 'pos': 'botleft', 'line': s:firstline, 'col': 10 })
endfunction

function! StartScrollingPopup() abort
	let s:popup_id = popup_create(s:text, {
		\ 'title': 'Scrolling Popup',
		\ 'pos': 'botleft',
		\ 'minwidth': 60,
		\ 'minheight': 10,
		\ 'maxheight': 10,
		\ 'border': [],
		\ 'scrollbar': 1,
		\ 'opacity': 100,
	\ })

	call timer_start(1000, function('s:scroll_popup'), {'repeat': -1})
endfunction

call StartScrollingPopup()

This is a video of the issue being triggered:

https://github.com/user-attachments/assets/21641b00-4604-4e8f-afe1-43caad7e2044

And this is a video with the fix applied:

https://github.com/user-attachments/assets/1a16ff76-7045-433c-83a9-b85f5d111114

Questions

Maybe this is a question for the mailing list, in this case I would ask in that channel. I would like to know which was the rationale behind the transparency feature, right now it looks like popup rendering with transparencies must end in flickering, since the background and frontend double drawing will force it. Is this a known limitation that will be addressed or it's a side effect that was unexpected when the feature was introduced?


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19534

Commit Summary

  • c17035d fix: flickering on opaque popups for overlapping text

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19534@github.com>

mattn

unread,
Mar 1, 2026, 3:03:25 AM (yesterday) Mar 1
to vim/vim, Subscribed
mattn left a comment (vim/vim#19534)

Please try #19536


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19534/c3979452225@github.com>

Javier Jaramago Fernández

unread,
Mar 1, 2026, 4:10:02 AM (yesterday) Mar 1
to vim/vim, Subscribed
JavierJF left a comment (vim/vim#19534)

Hi @mattn, I have tried your branch and it doesn't address the issue. Maybe I'm missing something, but to me it's clear that those changes can't fix the issue.

The issue is motivated by a double redrawn, as long as the double redraw takes place, a flicker might be seem. Unless this double redrawn is prevented, and the final character is drawn only once, this issue will continue to take place, for opaque or transparent popups (right now for both). This is why I have posted questions in the first comment on this PR, in case I was missing something, if I need to post those questions in the mailing list, please let me know! Thanks.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19534/c3979540919@github.com>

Maxim Kim

unread,
Mar 1, 2026, 5:26:01 PM (yesterday) Mar 1
to vim/vim, Subscribed
habamax left a comment (vim/vim#19534)

This PR fixes flickering for me:

Before:

vim-popups.gif (view on web)

After:

vim-popups2.gif (view on web)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19534/c3981172377@github.com>

Christian Brabandt

unread,
1:54 PM (7 hours ago) 1:54 PM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19534)

There are a few compile errors. Can you please fix those? I am also not sure, why so many tests fail, so let's hope those were flaky


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19534/c3986237702@github.com>

Reply all
Reply to author
Forward
0 new messages