aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-09-26 22:36:12 +0800
committerGitHub <noreply@github.com>2024-09-26 22:36:12 +0800
commitefcfcb1efce04aeef85c69a9337f96ec76e78043 (patch)
treeefbbe2d84732f85fd8509c5985ed0f7d8b02252c /test
parent66197dde7084484c9d23fa488b2288bcae364ba7 (diff)
parent65b6cd1b3a43024f6c2d9d6f31b8ae3a69dabb56 (diff)
downloadrneovim-efcfcb1efce04aeef85c69a9337f96ec76e78043.tar.gz
rneovim-efcfcb1efce04aeef85c69a9337f96ec76e78043.tar.bz2
rneovim-efcfcb1efce04aeef85c69a9337f96ec76e78043.zip
Merge pull request #30489 from zeertzjq/vim-9.1.0741
vim-patch:9.1.{0741,0742}: No way to get prompt for input()/confirm()
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_cmdline.vim27
1 files changed, 26 insertions, 1 deletions
diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim
index d00b5bbf46..d8a217fd05 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,31 @@ 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())
+ call feedkeys(":\<CR>\<ESC>", "xt")
+ call assert_equal('', g:cmdprompt)
+ call assert_equal('', getcmdprompt())
+
+ let str = "C" .. repeat("c", 1023) .. "xyz"
+ call feedkeys(":call input('" .. str .. "')\<CR>\<CR>\<ESC>", "xt")
+ call assert_equal(str, g:cmdprompt)
+
+ call feedkeys(':call input("Msg1\nMessage2\nAns?")' .. "\<CR>b\<CR>\<ESC>", "xt")
+ call assert_equal('Ans?', g:cmdprompt)
+ call assert_equal('', getcmdprompt())
+
+ augroup test_CmdlineEnter
+ au!
+ augroup END
+ augroup! test_CmdlineEnter
endfunc
func Test_getcmdwintype()