summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-11-06 17:58:35 +0100
committerBram Moolenaar <Bram@vim.org>2020-11-06 17:58:35 +0100
commit927495b1fef835a8f83c089bb3aa3608b617e972 (patch)
treeb6b5eb8a5e0ca9bcb15a0e078b4dcff9929b5ceb /src/screen.c
parent32e5ec0b017adb68fe36adb9a9a362abdaffe7f4 (diff)
downloadvim-git-927495b1fef835a8f83c089bb3aa3608b617e972.tar.gz
patch 8.2.1963: crash when using a popup window with "latin1" encodingv8.2.1963
Problem: Crash when using a popup window with "latin1" encoding. Solution: Don't use ScreenLinesUC when enc_utf8 is false. (closes #7241)
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/screen.c b/src/screen.c
index 6e907cdf4..b204de9bf 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -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)
{