diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-30 07:07:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-30 07:07:50 +0800 |
commit | 7f20d61e0036433a819cb89aa73baf81d4ff5d2c (patch) | |
tree | f1ba2d3514378e1f3fa44b538c8dda004ae81de1 /src/nvim/testdir | |
parent | f58a9795990a3b324f66912e4ae33dae7eb7474d (diff) | |
parent | e6e9879cb3eecf9d5c3f3964259a89dc36f60d52 (diff) | |
download | rneovim-7f20d61e0036433a819cb89aa73baf81d4ff5d2c.tar.gz rneovim-7f20d61e0036433a819cb89aa73baf81d4ff5d2c.tar.bz2 rneovim-7f20d61e0036433a819cb89aa73baf81d4ff5d2c.zip |
Merge pull request #19999 from zeertzjq/vim-9.0.0320
vim-patch:9.0.0320: command line type of CmdlineChange differs from getcmdtype()
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_cmdline.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index a5a30b7953..045504b8bf 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -2187,9 +2187,13 @@ endfunc func Test_setcmdline() func SetText(text, pos) + autocmd CmdlineChanged * let g:cmdtype = expand('<afile>') call assert_equal(0, setcmdline(a:text)) call assert_equal(a:text, getcmdline()) call assert_equal(len(a:text) + 1, getcmdpos()) + call assert_equal(getcmdtype(), g:cmdtype) + unlet g:cmdtype + autocmd! CmdlineChanged call assert_equal(0, setcmdline(a:text, a:pos)) call assert_equal(a:text, getcmdline()) @@ -2205,6 +2209,13 @@ func Test_setcmdline() call feedkeys(":\<C-R>=SetText('set rtp?', 2)\<CR>\<CR>", 'xt') call assert_equal('set rtp?', @:) + call feedkeys(":let g:str = input('? ')\<CR>", 't') + call feedkeys("\<C-R>=SetText('foo', 4)\<CR>\<CR>", 'xt') + call assert_equal('foo', g:str) + unlet g:str + + delfunc SetText + " setcmdline() returns 1 when not editing the command line. call assert_equal(1, 'foo'->setcmdline()) @@ -2217,6 +2228,8 @@ func Test_setcmdline() com! -nargs=* -complete=custom,CustomComplete DoCmd : call feedkeys(":DoCmd \<C-A>\<C-B>\"\<CR>", 'tx') call assert_equal('"DoCmd January February Mars', @:) + delcom DoCmd + delfunc CustomComplete " Called in <expr> cnoremap <expr>a setcmdline('let foo=') |