From 8a7b15cf35f9873395916487c33b817673c56d86 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Wed, 10 Aug 2016 23:52:25 -0400 Subject: vim-patch:7.4.1898 Problem: User commands don't support modifiers. Solution: Add the item. (Yegappan Lakshmanan, closes vim/vim#829) https://github.com/vim/vim/commit/63a60ded3fd584847a05dccf058026e682abad90 --- src/nvim/testdir/Makefile | 1 + src/nvim/testdir/test_usercommands.vim | 46 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/nvim/testdir/test_usercommands.vim (limited to 'src/nvim/testdir') 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 in user defined commands +function Test_cmdmods() + let g:mods = '' + + command! -nargs=* MyCmd let g: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 .= ' ' + vertical MyQCmd + call assert_equal('"vertical" ', g:mods) + + delcommand MyCmd + delcommand MyQCmd + + unlet g:mods +endfunction -- cgit