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: #15667
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index 3f6918a..17717d2 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -1617,7 +1617,7 @@
set cpo&
-func Test_getcmdtype()
+func Test_getcmdtype_getcmdprompt()
call feedkeys(":MyCmd a\<C-R>=Check_cmdline(':')\<CR>\<Esc>", "xt")
let cmdtype = ''
@@ -1641,6 +1641,20 @@
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_verbosefile()