diff src/testdir/test_popupwin.vim @ 17312:484424955bfa v8.1.1655

patch 8.1.1655: popup window border drawn wrong with multi-byte char commit https://github.com/vim/vim/commit/3dabd718f4b2d8e09de9e2ec73832620b91c2f79 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jul 8 23:30:22 2019 +0200 patch 8.1.1655: popup window border drawn wrong with multi-byte char Problem: Popup window border drawn wrong with multi-byte char. (Marcin Szamotulski) Solution: Correct check in mb_fix_col(). (closes #4635)
author Bram Moolenaar <Bram@vim.org>
date Mon, 08 Jul 2019 23:45:04 +0200
parents 8a095d343c59
children b60402471f69
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -113,6 +113,9 @@ func Test_popup_with_border_and_padding(
 	call popup_create(['hello border', 'with corners'], {'line': 2, 'col': 60, 'border': [], 'borderhighlight': ['BlueColor'], 'borderchars': ['x', '#']})
 	let winid = popup_create(['hello border', 'with numbers'], {'line': 6, 'col': 3, 'border': [], 'borderhighlight': ['BlueColor'], 'borderchars': ['0', '1', '2', '3', '4', '5', '6', '7']})
 	call popup_create(['hello border', 'just blanks'], {'line': 7, 'col': 23, 'border': [], 'borderhighlight': ['BlueColor'], 'borderchars': [' ']})
+	func MultiByte()
+	  call popup_create(['hello'], {'line': 8, 'col': 43, 'border': [], 'borderchars': ['─', '│', '─', '│', '┌', '┐', '┘', '└']})
+	endfunc
   END
   call writefile(lines, 'XtestPopupBorder')
   let buf = RunVimInTerminal('-S XtestPopupBorder', {'rows': 12})
@@ -122,6 +125,12 @@ func Test_popup_with_border_and_padding(
   call term_sendkeys(buf, ":call popup_setoptions(winid, {'borderchars': ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']})\<CR>")
   call VerifyScreenDump(buf, 'Test_popupwin_23', {})
 
+  " check multi-byte border only with 'ambiwidth' single
+  if &ambiwidth == 'single'
+    call term_sendkeys(buf, ":call MultiByte()\<CR>")
+    call VerifyScreenDump(buf, 'Test_popupwin_24', {})
+  endif
+
   call StopVimInTerminal(buf)
   call delete('XtestPopupBorder')