Fix Popup Redraw Issues and Borderhighlight Clearing#19297
Open
mattn wants to merge 2 commits intovim:masterfrom
Open
Fix Popup Redraw Issues and Borderhighlight Clearing#19297mattn wants to merge 2 commits intovim:masterfrom
mattn wants to merge 2 commits intovim:masterfrom
Conversation
- Fix popup_move() to redraw old position to clear ghost images - Fix popup_setoptions() to redraw when visual options change - Fix borderhighlight to be cleared with empty list [] - Add test for borderhighlight clearing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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()inpopupwin.cto 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 likeborderhighlight,scrollbarhighlight,thumbhighlight,zindex, orcursorlineflags, 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)zindexscrollbarhighlightthumbhighlightborderhighlightarrayProblem 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
borderhighlightprocessing inapply_general_options()to explicitly clear all border highlights when an empty list is provided.Changes
Files Modified
src/popupwin.c: Core fixes for popup renderingsrc/testdir/test_popupwin.vim: Added test for borderhighlight clearingTest Added
Testing
borderhighlightclearing: