mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00
vim-patch:8.2.0946: cannot use "q" to cancel a number prompt
Problem: Cannot use "q" to cancel a number prompt.
Solution: Recognize "q" instead of ignoring it.
eebd555733
This commit is contained in:
@@ -1067,6 +1067,18 @@ func Test_inputlist()
|
||||
call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\<cr>3\<cr>", 'tx')
|
||||
call assert_equal(3, c)
|
||||
|
||||
" CR to cancel
|
||||
call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\<cr>\<cr>", 'tx')
|
||||
call assert_equal(0, c)
|
||||
|
||||
" Esc to cancel
|
||||
call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\<cr>\<Esc>", 'tx')
|
||||
call assert_equal(0, c)
|
||||
|
||||
" q to cancel
|
||||
call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\<cr>q", 'tx')
|
||||
call assert_equal(0, c)
|
||||
|
||||
call assert_fails('call inputlist("")', 'E686:')
|
||||
endfunc
|
||||
|
||||
|
Reference in New Issue
Block a user