diff src/testdir/test_popupwin.vim @ 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 ff29f22c93f7
children 80bd5de5dcab
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -3685,6 +3685,28 @@ func Test_popupwin_filter_close_three_er
   call delete('XtestPopupThreeErrors')
 endfunc
 
+func Test_popupwin_latin1_encoding()
+  CheckScreendump
+  CheckUnix
+
+  " When 'encoding' is a single-byte encoding a terminal window will mess up
+  " the display.  Check that showing a popup on top of that doesn't crash.
+  let lines =<< trim END
+      set encoding=latin1
+      terminal cat Xmultibyte
+      call popup_create(['one', 'two', 'three', 'four'], #{line: 1, col: 10})
+  END
+  call writefile(lines, 'XtestPopupLatin')
+  call writefile([repeat("\u3042 ", 120)], 'Xmultibyte')
+
+  let buf = RunVimInTerminal('-S XtestPopupLatin', #{rows: 10})
+
+  call term_sendkeys(buf, ":q\<CR>")
+  call StopVimInTerminal(buf)
+  call delete('XtestPopupLatin')
+  call delete('Xmultibyte')
+endfunc
+
 func Test_popupwin_atcursor_far_right()
   new