diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-22 10:12:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-22 10:12:42 -0400 |
commit | 449bbf5540886a9b892b551162080e2dc9a37990 (patch) | |
tree | f600e2fa5888e5273aa6a7ef69e09cf407a1755f /src/nvim/testdir/test_functions.vim | |
parent | 6dd04ed5f6c0b68eed38aeb2a3f930d8d6353678 (diff) | |
parent | 486050ebc94d125b6a30340ec595ef62956624a7 (diff) | |
download | rneovim-449bbf5540886a9b892b551162080e2dc9a37990.tar.gz rneovim-449bbf5540886a9b892b551162080e2dc9a37990.tar.bz2 rneovim-449bbf5540886a9b892b551162080e2dc9a37990.zip |
Merge pull request #14601 from janlazo/vim-8.1.2320
vim-patch:8.1.{2320,2339},8.2.{946,1591,2875}
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r-- | src/nvim/testdir/test_functions.vim | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index 93f567b3a0..85d1bc7076 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -319,19 +319,19 @@ func Test_setbufvar_options() let prev_id = win_getid() wincmd j - let wh = winheight('.') + let wh = winheight(0) let dummy_buf = bufnr('dummy_buf1', v:true) call setbufvar(dummy_buf, '&buftype', 'nofile') execute 'belowright vertical split #' . dummy_buf - call assert_equal(wh, winheight('.')) + call assert_equal(wh, winheight(0)) let dum1_id = win_getid() wincmd h - let wh = winheight('.') + let wh = winheight(0) let dummy_buf = bufnr('dummy_buf2', v:true) call setbufvar(dummy_buf, '&buftype', 'nofile') execute 'belowright vertical split #' . dummy_buf - call assert_equal(wh, winheight('.')) + call assert_equal(wh, winheight(0)) bwipe! call win_gotoid(prev_id) @@ -1067,6 +1067,22 @@ 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) + + " Cancel after inputting a number + call feedkeys(":let c = inputlist(['Select color:', '1. red', '2. green', '3. blue'])\<cr>5q", 'tx') + call assert_equal(0, c) + call assert_fails('call inputlist("")', 'E686:') endfunc |