From 6af24b2457752c0d36aaf9f29f03d39afd09937f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 09:39:57 +0200 Subject: Merging upstream version 2:9.1.0199. Signed-off-by: Daniel Baumann --- src/testdir/test_cmdline.vim | 52 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) (limited to 'src/testdir/test_cmdline.vim') diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 4554712..7c86bcd 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -691,7 +691,7 @@ func Test_getcompletion() bw Xtest\ endif - call assert_fails("call getcompletion('\\\\@!\\\\@=', 'buffer')", 'E871:') + call assert_fails("call getcompletion('\\\\@!\\\\@=', 'buffer')", 'E866:') call assert_fails('call getcompletion("", "burp")', 'E475:') call assert_fails('call getcompletion("abc", [])', 'E1174:') endfunc @@ -917,6 +917,26 @@ func Test_cmdline_remove_char() let &encoding = encoding_save endfunc +func Test_cmdline_del_utf8() + let @s = '⒌' + call feedkeys(":\"\s,,\\\\", 'tx') + call assert_equal('",,', @:) + + let @s = 'a̳' + call feedkeys(":\"\s,,\\\\", 'tx') + call assert_equal('",,', @:) + + let @s = 'β̳' + call feedkeys(":\"\s,,\\\\", 'tx') + call assert_equal('",,', @:) + + if has('arabic') + let @s = 'لا' + call feedkeys(":\"\s,,\\\\", 'tx') + call assert_equal('",,', @:) + endif +endfunc + func Test_cmdline_keymap_ctrl_hat() CheckFeature keymap @@ -3742,4 +3762,34 @@ func Test_custom_completion_with_glob() delfunc TestGlobComplete endfunc +func Test_window_size_stays_same_after_changing_cmdheight() + set laststatus=2 + let expected = winheight(0) + function! Function_name() abort + call feedkeys(":"..repeat('x', &columns), 'x') + let &cmdheight=2 + let &cmdheight=1 + redraw + endfunction + call Function_name() + call assert_equal(expected, winheight(0)) +endfunc + +" verify that buffer-completion finds all buffer names matching a pattern +func Test_buffer_completion() + " should return empty list + call assert_equal([], getcompletion('', 'buffer')) + + call mkdir('Xbuf_complete', 'R') + e Xbuf_complete/Foobar.c + e Xbuf_complete/MyFoobar.c + e AFoobar.h + let expected = ["Xbuf_complete/Foobar.c", "Xbuf_complete/MyFoobar.c", "AFoobar.h"] + + call assert_equal(3, len(getcompletion('Foo', 'buffer'))) + call assert_equal(expected, getcompletion('Foo', 'buffer')) + call feedkeys(":b Foo\\\"\", 'xt') + call assert_equal("\"b Xbuf_complete/Foobar.c Xbuf_complete/MyFoobar.c AFoobar.h", @:) +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit v1.2.3