diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-09-24 06:51:02 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2024-09-26 22:15:28 +0800 |
commit | c2fb1fc700db28cb554be9da8e79443b5d3a5fe9 (patch) | |
tree | b90b04c1b252237d2d705422eebd8eef6d17d96f /test | |
parent | 66197dde7084484c9d23fa488b2288bcae364ba7 (diff) | |
download | rneovim-c2fb1fc700db28cb554be9da8e79443b5d3a5fe9.tar.gz rneovim-c2fb1fc700db28cb554be9da8e79443b5d3a5fe9.tar.bz2 rneovim-c2fb1fc700db28cb554be9da8e79443b5d3a5fe9.zip |
vim-patch:9.1.0741: No way to get prompt for input()/confirm()
Problem: No way to get prompt for input()/confirm()
Solution: add getcmdprompt() function (Shougo Matsushita)
(Shougo Matsushita)
closes: vim/vim#15667
https://github.com/vim/vim/commit/6908428560a0d6ae27bf7af6fcb6dc362e31926c
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_cmdline.vim | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim index d00b5bbf46..ba71f4b785 100644 --- a/test/old/testdir/test_cmdline.vim +++ b/test/old/testdir/test_cmdline.vim @@ -1534,7 +1534,7 @@ endfunc set cpo& -func Test_getcmdtype() +func Test_getcmdtype_getcmdprompt() call feedkeys(":MyCmd a\<C-R>=Check_cmdline(':')\<CR>\<Esc>", "xt") let cmdtype = '' @@ -1558,6 +1558,20 @@ func Test_getcmdtype() cunmap <F6> call assert_equal('', getcmdline()) + + call assert_equal('', getcmdprompt()) + augroup test_CmdlineEnter + autocmd! + autocmd CmdlineEnter * let g:cmdprompt=getcmdprompt() + augroup END + call feedkeys(":call input('Answer?')\<CR>a\<CR>\<ESC>", "xt") + call assert_equal('Answer?', g:cmdprompt) + call assert_equal('', getcmdprompt()) + + augroup test_CmdlineEnter + au! + augroup END + augroup! test_CmdlineEnter endfunc func Test_getcmdwintype() |