aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorAnmol Sethi <anmol@aubble.com>2016-08-10 23:52:25 -0400
committerAnmol Sethi <anmol@aubble.com>2016-08-24 11:51:59 -0400
commit8a7b15cf35f9873395916487c33b817673c56d86 (patch)
treea2c1cf023ce877d0cdf4fa01db5262f9c08692f6 /src/nvim/testdir
parent4d253b4df5cb19715007d1a2078841862704a057 (diff)
downloadrneovim-8a7b15cf35f9873395916487c33b817673c56d86.tar.gz
rneovim-8a7b15cf35f9873395916487c33b817673c56d86.tar.bz2
rneovim-8a7b15cf35f9873395916487c33b817673c56d86.zip
vim-patch:7.4.1898
Problem: User commands don't support modifiers. Solution: Add the <mods> item. (Yegappan Lakshmanan, closes vim/vim#829) https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/Makefile1
-rw-r--r--src/nvim/testdir/test_usercommands.vim46
2 files changed, 47 insertions, 0 deletions
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index 4979aae57a..b7aacc7b3b 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -36,6 +36,7 @@ NEW_TESTS = \
test_help_tagjump.res \
test_langmap.res \
test_syntax.res \
+ test_usercommands.res \
test_timers.res \
test_viml.res \
test_visual.res \
diff --git a/src/nvim/testdir/test_usercommands.vim b/src/nvim/testdir/test_usercommands.vim
new file mode 100644
index 0000000000..e8e9b6c18d
--- /dev/null
+++ b/src/nvim/testdir/test_usercommands.vim
@@ -0,0 +1,46 @@
+" Tests for user defined commands
+
+" Test for <mods> in user defined commands
+function Test_cmdmods()
+ let g:mods = ''
+
+ command! -nargs=* MyCmd let g:mods .= '<mods> '
+
+ MyCmd
+ aboveleft MyCmd
+ belowright MyCmd
+ botright MyCmd
+ browse MyCmd
+ confirm MyCmd
+ hide MyCmd
+ keepalt MyCmd
+ keepjumps MyCmd
+ keepmarks MyCmd
+ keeppatterns MyCmd
+ lockmarks MyCmd
+ noswapfile MyCmd
+ silent MyCmd
+ tab MyCmd
+ topleft MyCmd
+ verbose MyCmd
+ vertical MyCmd
+ aboveleft belowright botright browse confirm hide keepalt keepjumps
+ \ keepmarks keeppatterns lockmarks noswapfile silent tab
+ \ topleft verbose vertical MyCmd
+ call assert_equal(' aboveleft belowright botright browse confirm ' .
+ \ 'hide keepalt keepjumps keepmarks keeppatterns lockmarks ' .
+ \ 'noswapfile silent tab topleft verbose vertical aboveleft ' .
+ \ 'belowright botright browse confirm hide keepalt keepjumps ' .
+ \ 'keepmarks keeppatterns lockmarks noswapfile silent tab topleft ' .
+ \ 'verbose vertical ', g:mods)
+ let g:mods = ''
+
+ command! -nargs=* MyQCmd let g:mods .= '<q-mods> '
+ vertical MyQCmd
+ call assert_equal('"vertical" ', g:mods)
+
+ delcommand MyCmd
+ delcommand MyQCmd
+
+ unlet g:mods
+endfunction