Mercurial > vim
comparison src/screen.c @ 22832:8059beb101d0 v8.2.1963
patch 8.2.1963: crash when using a popup window with "latin1" encoding
Commit: https://github.com/vim/vim/commit/927495b1fef835a8f83c089bb3aa3608b617e972
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Nov 6 17:58:35 2020 +0100
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 https://github.com/vim/vim/issues/7241)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 06 Nov 2020 18:00:03 +0100 |
parents | f7f2d73ff85e |
children | 6d50182e7e24 |
comparison
equal
deleted
inserted
replaced
22831:cb3da944f4be | 22832:8059beb101d0 |
---|---|
462 | 462 |
463 #ifdef FEAT_PROP_POPUP | 463 #ifdef FEAT_PROP_POPUP |
464 // First char of a popup window may go on top of the right half of a | 464 // First char of a popup window may go on top of the right half of a |
465 // double-wide character. Clear the left half to avoid it getting the popup | 465 // double-wide character. Clear the left half to avoid it getting the popup |
466 // window background color. | 466 // window background color. |
467 if (coloff > 0 && ScreenLines[off_to] == 0 | 467 if (coloff > 0 && enc_utf8 |
468 && ScreenLines[off_to] == 0 | |
468 && ScreenLinesUC[off_to - 1] != 0 | 469 && ScreenLinesUC[off_to - 1] != 0 |
469 && (*mb_char2cells)(ScreenLinesUC[off_to - 1]) > 1) | 470 && (*mb_char2cells)(ScreenLinesUC[off_to - 1]) > 1) |
470 { | 471 { |
471 ScreenLines[off_to - 1] = ' '; | 472 ScreenLines[off_to - 1] = ' '; |
472 ScreenLinesUC[off_to - 1] = 0; | 473 ScreenLinesUC[off_to - 1] = 0; |