diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-06-22 20:39:17 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-06-22 20:39:17 +0200 |
commit | 6f9a476b2f2f0bb5c50d703ec4fc535ffd5bfe8f (patch) | |
tree | 6911e1c75f4601d5cf3e356b9a9ee00578bef695 | |
parent | d6abcd154cdc6a8dd4b7c6ccad37617ea8a1b4aa (diff) | |
download | vim-git-6f9a476b2f2f0bb5c50d703ec4fc535ffd5bfe8f.tar.gz |
patch 8.0.0656: cannot use ! after some user commandsv8.0.0656
Problem: Cannot use ! after some user commands.
Solution: Properly check for existing command. (Higashi Higashi)
-rw-r--r-- | src/ex_docmd.c | 3 | ||||
-rw-r--r-- | src/testdir/test_vimscript.vim | 9 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 9dac9bf3a..bdd152dfd 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2370,7 +2370,8 @@ do_one_cmd( goto doend; } /* Check for wrong commands. */ - if (*p == '!' && ea.cmd[1] == 0151 && ea.cmd[0] == 78) + if (*p == '!' && ea.cmd[1] == 0151 && ea.cmd[0] == 78 + && !IS_USER_CMDIDX(ea.cmdidx)) { errormsg = uc_fun_cmd(); goto doend; diff --git a/src/testdir/test_vimscript.vim b/src/testdir/test_vimscript.vim index c09e2343b..c0736f2ba 100644 --- a/src/testdir/test_vimscript.vim +++ b/src/testdir/test_vimscript.vim @@ -1400,6 +1400,15 @@ func Test_delfunction_force() delfunc! Xtest endfunc +" Test using bang after user command {{{1 +func Test_user_command_with_bang() + command -bang Nieuw let nieuw = 1 + Ni! + call assert_equal(1, nieuw) + unlet nieuw + delcommand Nieuw +endfunc + "------------------------------------------------------------------------------- " Modelines {{{1 " vim: ts=8 sw=4 tw=80 fdm=marker diff --git a/src/version.c b/src/version.c index 533660fa0..fd57e48ac 100644 --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 656, +/**/ 655, /**/ 654, |