summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_cmdline.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:39:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 07:40:16 +0000
commit6af24b2457752c0d36aaf9f29f03d39afd09937f (patch)
tree2671b594908d1f971de6b2a2d473f97dfb7291d2 /src/testdir/test_cmdline.vim
parentReleasing progress-linux version 2:9.1.0016-1~progress7.99u1. (diff)
downloadvim-6af24b2457752c0d36aaf9f29f03d39afd09937f.tar.xz
vim-6af24b2457752c0d36aaf9f29f03d39afd09937f.zip
Merging upstream version 2:9.1.0199.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/testdir/test_cmdline.vim')
-rw-r--r--src/testdir/test_cmdline.vim52
1 files changed, 51 insertions, 1 deletions
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(":\"\<C-R>s,,\<C-B>\<Right>\<Del>\<CR>", 'tx')
+ call assert_equal('",,', @:)
+
+ let @s = 'a̳'
+ call feedkeys(":\"\<C-R>s,,\<C-B>\<Right>\<Del>\<CR>", 'tx')
+ call assert_equal('",,', @:)
+
+ let @s = 'β̳'
+ call feedkeys(":\"\<C-R>s,,\<C-B>\<Right>\<Del>\<CR>", 'tx')
+ call assert_equal('",,', @:)
+
+ if has('arabic')
+ let @s = 'لا'
+ call feedkeys(":\"\<C-R>s,,\<C-B>\<Right>\<Del>\<CR>", '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\<C-A>\<C-B>\"\<CR>", 'xt')
+ call assert_equal("\"b Xbuf_complete/Foobar.c Xbuf_complete/MyFoobar.c AFoobar.h", @:)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab