aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKunMing Xie <qqzz014@gmail.com>2017-12-03 00:25:50 +0800
committerJustin M. Keyes <justinkz@gmail.com>2017-12-02 17:25:50 +0100
commit44421a22c0d9e8e2181d9338a36d1a4ec1f329be (patch)
treef3b7a1c503b0824ecd851c197f10e2bd63bcf451 /src
parentad32307e3b1576cc743a6ab71d54381017f5a70d (diff)
downloadrneovim-44421a22c0d9e8e2181d9338a36d1a4ec1f329be.tar.gz
rneovim-44421a22c0d9e8e2181d9338a36d1a4ec1f329be.tar.bz2
rneovim-44421a22c0d9e8e2181d9338a36d1a4ec1f329be.zip
vim-patch:8.0.0306 (#7675)
Problem: mode() not sufficiently tested. Solution: Add more tests. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/e971df39a5aac5d9b7e8033247dc18b12daa0eb8
Diffstat (limited to 'src')
-rw-r--r--src/nvim/testdir/test_functions.vim34
-rw-r--r--src/nvim/version.c2
2 files changed, 35 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim
index 59807ca946..0ce034b63e 100644
--- a/src/nvim/testdir/test_functions.vim
+++ b/src/nvim/testdir/test_functions.vim
@@ -207,39 +207,73 @@ func! Test_mode()
normal! 3G
exe "normal i\<F2>\<Esc>"
call assert_equal('i-i', g:current_modes)
+ " i_CTRL-P: Multiple matches
exe "normal i\<C-G>uBa\<C-P>\<F2>\<Esc>u"
call assert_equal('i-ic', g:current_modes)
+ " i_CTRL-P: Single match
exe "normal iBro\<C-P>\<F2>\<Esc>u"
call assert_equal('i-ic', g:current_modes)
+ " i_CTRL-X
exe "normal iBa\<C-X>\<F2>\<Esc>u"
call assert_equal('i-ix', g:current_modes)
+ " i_CTRL-X CTRL-P: Multiple matches
exe "normal iBa\<C-X>\<C-P>\<F2>\<Esc>u"
call assert_equal('i-ic', g:current_modes)
+ " i_CTRL-X CTRL-P: Single match
exe "normal iBro\<C-X>\<C-P>\<F2>\<Esc>u"
call assert_equal('i-ic', g:current_modes)
+ " i_CTRL-X CTRL-P + CTRL-P: Single match
exe "normal iBro\<C-X>\<C-P>\<C-P>\<F2>\<Esc>u"
call assert_equal('i-ic', g:current_modes)
+ " i_CTRL-X CTRL-L: Multiple matches
+ exe "normal i\<C-X>\<C-L>\<F2>\<Esc>u"
+ call assert_equal('i-ic', g:current_modes)
+ " i_CTRL-X CTRL-L: Single match
+ exe "normal iBlu\<C-X>\<C-L>\<F2>\<Esc>u"
+ call assert_equal('i-ic', g:current_modes)
+ " i_CTRL-P: No match
exe "normal iCom\<C-P>\<F2>\<Esc>u"
call assert_equal('i-ic', g:current_modes)
+ " i_CTRL-X CTRL-P: No match
exe "normal iCom\<C-X>\<C-P>\<F2>\<Esc>u"
call assert_equal('i-ic', g:current_modes)
+ " i_CTRL-X CTRL-L: No match
+ exe "normal iabc\<C-X>\<C-L>\<F2>\<Esc>u"
+ call assert_equal('i-ic', g:current_modes)
+ " R_CTRL-P: Multiple matches
exe "normal RBa\<C-P>\<F2>\<Esc>u"
call assert_equal('R-Rc', g:current_modes)
+ " R_CTRL-P: Single match
exe "normal RBro\<C-P>\<F2>\<Esc>u"
call assert_equal('R-Rc', g:current_modes)
+ " R_CTRL-X
exe "normal RBa\<C-X>\<F2>\<Esc>u"
call assert_equal('R-Rx', g:current_modes)
+ " R_CTRL-X CTRL-P: Multiple matches
exe "normal RBa\<C-X>\<C-P>\<F2>\<Esc>u"
call assert_equal('R-Rc', g:current_modes)
+ " R_CTRL-X CTRL-P: Single match
exe "normal RBro\<C-X>\<C-P>\<F2>\<Esc>u"
call assert_equal('R-Rc', g:current_modes)
+ " R_CTRL-X CTRL-P + CTRL-P: Single match
exe "normal RBro\<C-X>\<C-P>\<C-P>\<F2>\<Esc>u"
call assert_equal('R-Rc', g:current_modes)
+ " R_CTRL-X CTRL-L: Multiple matches
+ exe "normal R\<C-X>\<C-L>\<F2>\<Esc>u"
+ call assert_equal('R-Rc', g:current_modes)
+ " R_CTRL-X CTRL-L: Single match
+ exe "normal RBlu\<C-X>\<C-L>\<F2>\<Esc>u"
+ call assert_equal('R-Rc', g:current_modes)
+ " R_CTRL-P: No match
exe "normal RCom\<C-P>\<F2>\<Esc>u"
call assert_equal('R-Rc', g:current_modes)
+ " R_CTRL-X CTRL-P: No match
exe "normal RCom\<C-X>\<C-P>\<F2>\<Esc>u"
call assert_equal('R-Rc', g:current_modes)
+ " R_CTRL-X CTRL-L: No match
+ exe "normal Rabc\<C-X>\<C-L>\<F2>\<Esc>u"
+ call assert_equal('R-Rc', g:current_modes)
call assert_equal('n', mode(0))
call assert_equal('n', mode(1))
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 24ee7ddffc..8d85855c6e 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -950,7 +950,7 @@ static const int included_patches[] = {
// 309,
308,
307,
- // 306,
+ 306,
305,
// 304,
// 303,