[vim/vim] popup: refresh popup mask when scrollbar visibility changes (PR #20098)

3 views
Skip to first unread message

mattn

unread,
Apr 29, 2026, 8:50:06 PM (2 days ago) Apr 29
to vim/vim, Subscribed

popup_adjust_position() decides whether to refresh popup_mask by comparing a fixed set of fields (w_winrow, w_wincol, w_leftcol, w_popup_leftoff, w_width, w_height). It does not consider w_has_scrollbar, and w_width is the popup's inner content width, which doesn't include the scrollbar column. So when popup_settext() shrinks the buffer enough that the scrollbar disappears, none of the tracked fields change, the mask refresh is skipped, and the cell that held the old border / scrollbar is never repainted, leaving stray characters on the right of the popup.

The regression was introduced in 9.2.0112, which replaced the global redraw_win_later(UPD_NOT_VALID) in f_popup_settext() with a popup-local redraw. Before that, the global must_redraw propagation forced may_update_popup_mask() to refresh the mask anyway, masking this gap.

For a centered popup, losing the scrollbar drops extra_width by 1, so w_wincol = (Columns - w_width - extra_width) / 2 would normally shift by 1 and trip the existing org_wincol != w_wincol branch. Whether the shift actually happens depends on the parity of Columns due to integer truncation, so the bug only surfaced at odd terminal widths or with pos: 'topleft' popups whose w_wincol is anchored.

Fix: also compare w_has_scrollbar in the change detection.

Closes #20092


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

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

Commit Summary

  • c23ea5b popup: refresh popup mask when scrollbar visibility changes

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20098@github.com>

mattn

unread,
Apr 29, 2026, 8:51:33 PM (2 days ago) Apr 29
to vim/vim, Subscribed
mattn left a comment (vim/vim#20098)

I'll add test.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

mattn

unread,
Apr 29, 2026, 8:55:29 PM (2 days ago) Apr 29
to vim/vim, Push

@mattn pushed 1 commit.

  • 5287bdd popup: add test for scrollbar-disappearing redraw


View it on GitHub or unsubscribe.


Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20098/before/c23ea5bb3b77ae873bd80dfaa9d590d9976684bb/after/5287bddd00be160904f9518573c9f5f55a83f9c8@github.com>

mattn

unread,
Apr 29, 2026, 9:34:24 PM (2 days ago) Apr 29
to vim/vim, Push

@mattn pushed 1 commit.

  • ba3e199 popup: regenerate scrollbar-disappear test dumps


View it on GitHub or unsubscribe.


Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20098/before/5287bddd00be160904f9518573c9f5f55a83f9c8/after/ba3e199d165647ac9e1af65d81c37e6cb31d042e@github.com>

Christian Brabandt

unread,
9:10 AM (4 hours ago) 9:10 AM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20098)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Christian Brabandt

unread,
9:20 AM (4 hours ago) 9:20 AM
to vim/vim, Subscribed

Closed #20098 via ba85f88.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Reply all
Reply to author
Forward
0 new messages