Skip to content

avoid overwriting right-top corner when drawing top border#19299

Open
mattn wants to merge 5 commits intovim:masterfrom
mattn:fix-popup-right-corner
Open

avoid overwriting right-top corner when drawing top border#19299
mattn wants to merge 5 commits intovim:masterfrom
mattn:fix-popup-right-corner

Conversation

@mattn
Copy link
Member

@mattn mattn commented Jan 31, 2026

When drawing the top border of a popup window, screen_fill() was called with wincol + total_width as the end column, which caused it to overwrite the right-top corner character (border_char[5]) that is placed at wincol + total_width - 1. The overwritten character would display with attr=0 (default background), appearing as black.

image

So, change the end column from wincol + total_width to wincol + total_width - 1, so that screen_fill() does not overwrite
the right-top corner character. This fix applies to all popup windows, including those using multibyte
characters for borders.

@chrisbra
Copy link
Member

chrisbra commented Feb 1, 2026

Hm, if you inspect the dump files, this looks slightly wrong:
image
image

Now it seems the border is drawn 1 char too short?

@mattn mattn force-pushed the fix-popup-right-corner branch from 138ffdd to 6cc52d3 Compare February 2, 2026 01:30
@mattn
Copy link
Member Author

mattn commented Feb 2, 2026

I updated patch. I want to test with same dump file. Which dump file do you use?

mattn added 5 commits February 4, 2026 17:13
When a popup window's border overwrites part of a wide character from
another popup, the remaining half should preserve its original attribute
(background color) instead of being reset to 0.

The fix modifies screen_fill() to save and use the existing ScreenAttrs
value when clearing wide character boundaries, rather than using attr=0.
@mattn mattn force-pushed the fix-popup-right-corner branch from 139d39f to bc94bc3 Compare February 4, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants