[vim/vim] Fix opacity popup flicker on Win32 console (PR #19697)

4 views
Skip to first unread message

mattn

unread,
Mar 15, 2026, 9:17:59 AM (3 days ago) Mar 15
to vim/vim, Subscribed

On Win32 console, BSU/ESU (Synchronized Output) is not supported.

This causes visible flickering when moving the cursor while opacity popups are displayed.

The cause is that background lines under opacity popups are redrawn every cycle. During this redraw, unblended background characters are output to the console via screen_char() before update_popups() can draw the blended result on top. On terminals with BSU/ESU support, this intermediate state is buffered and invisible. On Win32 console, writes go directly to the screen buffer, making the flicker visible.

The fix adds a check at the top of screen_char(): if the cell is covered by a higher-zindex opacity popup, output is skipped. The per-cell zindex is stored in an opacity_zindex array built in may_update_popup_mask(), allocated only when opacity popups exist.
T_CE (clear-to-eol) optimization is also disabled for lines that overlap with opacity popups. screen_char_2() gets the same check to prevent the second byte of DBCS characters from leaking through.

Additionally, the wide character boundary clearing in screen_line() now skips cells that belong to another opacity popup, preventing flicker at the edge where two opacity popups meet.

Although the primary motivation is Win32 console, the fix is platform-independent and also benefits terminals that do not support BSU/ESU synchronized output.


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

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

Commit Summary

  • e673b04 Fix opacity popup flicker on Win32 console

File Changes

(3 files)

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/19697@github.com>

Christian Brabandt

unread,
Mar 16, 2026, 3:18:38 PM (2 days ago) Mar 16
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19697)

Thanks. Did this break this test case?

From test_popupwin.vim:
Found errors in Test_popup_opacity_wide_char_overlap():
Run 1, 14:37:58 - 14:38:00 in 1.686971 seconds:
command line..script /home/runner/work/vim/vim/src/testdir/runtest.vim[636]..function RunTheTest[63]..Test_popup_opacity_wide_char_overlap[37]..VerifyScreenDump line 102: See dump file difference: call term_dumpdiff("testdir/failed/Test_popupwin_opacity_wide_1.dump", "testdir/dumps/Test_popupwin_opacity_wide_1.dump"); difference in line 4: "|い*&|え0#ffffff16#e000002|ー@6| +&| +0#0000000#ffffff0|ー&@7|い|!+&| |4| @3"; difference in line 5: "|い*&| +0#ffffff16#e000002|カ*&|ラ|フ|ル|な| +&|ー*&@1| +&| +0#0000000#ffffff0|ー*&@7|い|!+&| |5| @3"


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

mattn

unread,
Mar 16, 2026, 7:27:39 PM (2 days ago) Mar 16
to vim/vim, Push

@mattn pushed 1 commit.

  • fa88a3a Fix opacity popup flicker on Win32 console


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19697/before/e673b043b6cd836ee936b6af597fbba14fcc09a1/after/fa88a3a58ccd9f3cdda41c03bd4f4753cf7b59e6@github.com>

mattn

unread,
Mar 16, 2026, 7:49:19 PM (2 days ago) Mar 16
to vim/vim, Push

@mattn pushed 1 commit.

  • 5ffcc50 Fix opacity popup flicker on Win32 console

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19697/before/fa88a3a58ccd9f3cdda41c03bd4f4753cf7b59e6/after/5ffcc50dd76f34ce80da691d50641cc5d5404c0f@github.com>

mattn

unread,
Mar 16, 2026, 8:11:36 PM (2 days ago) Mar 16
to vim/vim, Push

@mattn pushed 1 commit.

  • 3031a55 Merge branch 'master' into fix-opacity-popup-flicker

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19697/before/6237ed6c1cac67a8716ea5122267376c38993e8e/after/3031a55ea0bacc4493b676c60342ce6b5ff97142@github.com>

mattn

unread,
Mar 16, 2026, 8:54:01 PM (2 days ago) Mar 16
to vim/vim, Push

@mattn pushed 1 commit.

  • 1a52180 Merge branch 'master' into fix-opacity-popup-flicker

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19697/before/3031a55ea0bacc4493b676c60342ce6b5ff97142/after/1a521806e5cc9a6e8071eb4936df6caa83848dd7@github.com>

mattn

unread,
Mar 16, 2026, 8:58:33 PM (2 days ago) Mar 16
to vim/vim, Push

@mattn pushed 1 commit.

  • 354f611 Merge branch 'master' into fix-opacity-popup-flicker

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19697/before/1a521806e5cc9a6e8071eb4936df6caa83848dd7/after/354f61165f4b3c0fb1022ca7799140d1edac4509@github.com>

mattn

unread,
Mar 16, 2026, 9:30:01 PM (2 days ago) Mar 16
to vim/vim, Push

@mattn pushed 1 commit.

  • 0b4b61c Fix CI: update opacity wide char dump and preproc indent

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19697/before/354f61165f4b3c0fb1022ca7799140d1edac4509/after/0b4b61ca7d142584ee1a514b95747565371cb0fb@github.com>

mattn

unread,
Mar 16, 2026, 9:44:00 PM (2 days ago) Mar 16
to vim/vim, Push

@mattn pushed 1 commit.

  • e79c73a Merge branch 'master' into fix-opacity-popup-flicker

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19697/before/0b4b61ca7d142584ee1a514b95747565371cb0fb/after/e79c73a3aad8d98dfec1e260f50d37131f958659@github.com>

mattn

unread,
Mar 16, 2026, 9:46:07 PM (2 days ago) Mar 16
to vim/vim, Push

@mattn pushed 1 commit.

  • de3124d Fix CI: update opacity wide char dump and preproc indent

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19697/before/e79c73a3aad8d98dfec1e260f50d37131f958659/after/de3124d389a13e511677b0cc076d7e70a62f196b@github.com>

Christian Brabandt

unread,
Mar 17, 2026, 4:48:42 PM (7 hours ago) Mar 17
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19697)

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/19697/c4077918228@github.com>

Christian Brabandt

unread,
Mar 17, 2026, 4:56:13 PM (7 hours ago) Mar 17
to vim/vim, Subscribed

Closed #19697 via 019c53b.


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

Reply all
Reply to author
Forward
0 new messages