changeset 14750:1e6666885bc0 v8.1.0387

patch 8.1.0387: no test for 'ambiwidth' detection commit https://github.com/vim/vim/commit/24839edc54e985ed88d063513226922a6f5b7554 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 13 20:46:52 2018 +0200 patch 8.1.0387: no test for 'ambiwidth' detection Problem: No test for 'ambiwidth' detection. Solution: Add a test.
author Christian Brabandt <cb@256bit.org>
date Thu, 13 Sep 2018 21:00:06 +0200
parents 706a5bcea803
children b4cfad5cfb6d
files src/testdir/test_startup_utf8.vim src/version.c
diffstat 2 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_startup_utf8.vim
+++ b/src/testdir/test_startup_utf8.vim
@@ -4,6 +4,7 @@ if !has('multi_byte')
 endif
 
 source shared.vim
+source screendump.vim
 
 func Test_read_stdin_utf8()
   let linesin = ['テスト', '€ÀÈÌÒÙ']
@@ -62,3 +63,24 @@ func Test_read_fifo_utf8()
   call delete('Xtestout')
   call delete('Xtestin')
 endfunc
+
+func Test_detect_ambiwidth()
+  if !CanRunVimInTerminal()
+    return
+  endif
+
+  " Use the title termcap entries to output the escape sequence.
+  call writefile([
+	\ 'set enc=utf-8',
+	\ 'set ambiwidth=double',
+	\ 'call test_option_not_set("ambiwidth")',
+	\ 'redraw',
+	\ ], 'Xscript')
+  let buf = RunVimInTerminal('-S Xscript', {})
+  call term_wait(buf)
+  call term_sendkeys(buf, "S\<C-R>=&ambiwidth\<CR>\<Esc>")
+  call WaitForAssert({-> assert_match('single', term_getline(buf, 1))})
+
+  call StopVimInTerminal(buf)
+  call delete('Xscript')
+endfunc
--- a/src/version.c
+++ b/src/version.c
@@ -795,6 +795,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    387,
+/**/
     386,
 /**/
     385,