mirror of
https://github.com/neovim/neovim.git
synced 2025-12-11 00:52:44 +00:00
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
6908428560
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user