0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.1963: crash when using a popup window with "latin1" encoding

Problem:    Crash when using a popup window with "latin1" encoding.
Solution:   Don't use ScreenLinesUC when enc_utf8 is false. (closes #7241)
This commit is contained in:
Bram Moolenaar
2020-11-06 17:58:35 +01:00
parent 32e5ec0b01
commit 927495b1fe
4 changed files with 42 additions and 5 deletions

View File

@@ -464,7 +464,8 @@ screen_line(
// First char of a popup window may go on top of the right half of a
// double-wide character. Clear the left half to avoid it getting the popup
// window background color.
if (coloff > 0 && ScreenLines[off_to] == 0
if (coloff > 0 && enc_utf8
&& ScreenLines[off_to] == 0
&& ScreenLinesUC[off_to - 1] != 0
&& (*mb_char2cells)(ScreenLinesUC[off_to - 1]) > 1)
{