[vim/vim] Fix Popup Redraw Issues and Borderhighlight Clearing (PR #19297)

1 view
Skip to first unread message

mattn

unread,
Jan 31, 2026, 8:30:02 AMJan 31
to vim/vim, Subscribed

This PR fixes several issues related to popup window rendering and option handling in Vim.

Problem 1: Ghost Images When Moving Popups

When using popup_move() to move a popup window (e.g., with hjkl keys in the vim-popup-manager plugin), ghost images of the popup remained on the screen. The old position was not being redrawn.

Solution

Modified f_popup_move() in popupwin.c to save the old position before moving and force a full redraw when the position changes.

Problem 2: Visual Options Not Redrawn

When calling popup_setoptions() with visual options like borderhighlight, scrollbarhighlight, thumbhighlight, zindex, or cursorline flags, the changes were not immediately visible because no redraw was triggered.

Solution

Enhanced f_popup_setoptions() to check for changes in visual-affecting options and trigger a redraw when any of them change:

  • firstline (already existed)
  • zindex
  • Popup flags (cursorline, drag, resize, etc.)
  • scrollbarhighlight
  • thumbhighlight
  • borderhighlight array

Problem 3: Cannot Clear borderhighlight

Setting borderhighlight: [] did not clear the border highlights. The loop that processed the list only updated highlights when the list had items, so an empty list would not clear existing highlights.

Solution

Modified the borderhighlight processing in apply_general_options() to explicitly clear all border highlights when an empty list is provided.

Changes

Files Modified

  • src/popupwin.c: Core fixes for popup rendering
  • src/testdir/test_popupwin.vim: Added test for borderhighlight clearing

Test Added

" Check that borderhighlight can be cleared with empty list
call popup_setoptions(winid, #{borderhighlight: []})
let options_cleared = popup_getoptions(winid)
call assert_equal([], options_cleared.borderhighlight)

Testing

  1. Build Vim with these changes
  2. Test with vim-popup-manager plugin - hjkl movement should not leave ghost images
  3. Test borderhighlight clearing:
    let winid = popup_create('test', #{border: [], borderhighlight: ['WarningMsg']})
    call popup_setoptions(winid, #{borderhighlight: []})
    " Border highlight should now be cleared

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

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

Commit Summary

  • 00d1846 popup_move must redraw
  • 3f75605 Fix popup redraw issues and borderhighlight clearing

File Changes

(2 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/19297@github.com>

Christian Brabandt

unread,
Feb 15, 2026, 12:42:59 PM (21 hours ago) Feb 15
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19297)

Thanks, can you please fix the CI errors?


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

Reply all
Reply to author
Forward
0 new messages