[vim/vim] Fix wide character display with popups (PR #19271)

14 views
Skip to first unread message

mattn

unread,
Jan 29, 2026, 3:18:56 AM (10 days ago) Jan 29
to vim/vim, Subscribed

Problem

When a popup window partially overlaps a wide character (e.g., Japanese characters):

  1. Truncated display: If only the right half of a wide character is visible, the character was displayed with its right half cut off, violating Vim's rule that "wide characters with only half visible should not be shown at all."

  2. Garbage display: Old character data remained in the screen buffer and was visible through the popup, appearing as garbage.

Reproduction

call setline(1, 'This is line 1')
call setline(2, 'あいうえお')
call setline(3, '        かきくけこ')
hi MyPopup guibg=darkblue guifg=white
call popup_create(['FOO  BAR'], #{
\ line: 1,
\ col: 2,
\ minwidth: 15,
\ minheight: 3,
\ highlight: 'MyPopup',
\})

Before: The first character "あ" in line 2 shows only its left half (truncated). When adding spaces to line 3, garbage appears where the right half of "け" would be.

After: Characters are completely hidden when partially overlapped, and no garbage appears.

image.png (view on web)

Left half of あ must not be shown.

image.png (view on web)

Right half of "け" must be shown as a space.

Solution

In screen.c, when rendering wide characters that are partially blocked by a popup:

  • Clear both cells of the wide character in ScreenLines to prevent garbage
  • Only draw the cells that are not blocked by the popup
  • Skip drawing the entire wide character (set redraw_this = FALSE)

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

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

Commit Summary

  • a870436 Fix wide character display with popups

File Changes

(1 file)

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

mattn

unread,
Jan 29, 2026, 3:59:02 AM (10 days ago) Jan 29
to vim/vim, Push

@mattn pushed 1 commit.

  • 813da06 Fix wide character display with popups


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

vim-dev ML

unread,
Jan 29, 2026, 4:15:30 AM (10 days ago) Jan 29
to vim/vim, vim-dev ML, Your activity
vim-ml left a comment (vim/vim#19271)
> **Before**: The first character &quot;あ&quot; in line 2 shows only its left half (truncated). When adding spaces to line 3, garbage appears where the right half of &quot;け&quot; would be.
> **After**: Characters are completely hidden when partially overlapped, and no garbage appears.

ref: https://github.com/vim/vim/issues/9874

--
shane.xb.qian


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

mattn

unread,
Jan 30, 2026, 5:32:04 AM (9 days ago) Jan 30
to vim/vim, vim-dev ML, Push

@mattn pushed 1 commit.

  • ce5fdd7 Fix wide character display with popups

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19271/before/813da0632758709a0bf9a16e92fd06f4c1ffac55/after/ce5fdd75b8b63050a1f48982ff3d3e739ff876d8@github.com>

mattn

unread,
Jan 30, 2026, 6:24:21 AM (9 days ago) Jan 30
to vim/vim, vim-dev ML, Push

@mattn pushed 1 commit.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19271/before/ce5fdd75b8b63050a1f48982ff3d3e739ff876d8/after/3feed029e9dbc507ee9e46286d86017f469bd637@github.com>

mattn

unread,
Jan 31, 2026, 8:59:13 AM (8 days ago) Jan 31
to vim/vim, vim-dev ML, Comment
mattn left a comment (vim/vim#19271)

This still wrong.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/19271/c3828577008@github.com>

mattn

unread,
Jan 31, 2026, 12:10:59 PM (8 days ago) Jan 31
to vim/vim, vim-dev ML, Push

@mattn pushed 3 commits.

  • 330ca5a Fix wide character display with popups
  • 5ea0cef revert
  • 881447a skip redrawing second cell of wide char when blocked by popup

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19271/before/3feed029e9dbc507ee9e46286d86017f469bd637/after/881447a9082942374148d7c32b18d367c47714b0@github.com>

mattn

unread,
Jan 31, 2026, 12:15:21 PM (8 days ago) Jan 31
to vim/vim, vim-dev ML, Comment
mattn left a comment (vim/vim#19271)

I have identified what is happening and what needs to be fixed.

This issue has two problems.

This pull request fixes only one of them. When the left edge of the popup dialog overlaps the right half of a multibyte character, set the redraw_this flag to TRUE.

And the other issue, where the right side of the pop-up dialog is not rendered correctly,
is fixed in:
#19299


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/19271/c3828857256@github.com>

mattn

unread,
Feb 4, 2026, 3:14:14 AM (4 days ago) Feb 4
to vim/vim, vim-dev ML, Push

@mattn pushed 3 commits.

  • a18ca89 Fix wide character display with popups
  • 7120595 revert
  • d398f4b skip redrawing second cell of wide char when blocked by popup

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19271/before/881447a9082942374148d7c32b18d367c47714b0/after/d398f4b15575cc5596bbb3bed4976c808238dd4d@github.com>

Christian Brabandt

unread,
Feb 7, 2026, 4:35:08 PM (19 hours ago) Feb 7
to vim/vim, vim-dev ML, Comment
chrisbra left a comment (vim/vim#19271)

can you please add a screendump test for the problem that this fixes?


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/19271/c3865521577@github.com>

Reply all
Reply to author
Forward
0 new messages