]> granicus.if.org Git - vim/commitdiff
patch 8.0.0656: cannot use ! after some user commands v8.0.0656
authorBram Moolenaar <Bram@vim.org>
Thu, 22 Jun 2017 18:39:17 +0000 (20:39 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 22 Jun 2017 18:39:17 +0000 (20:39 +0200)
Problem:    Cannot use ! after some user commands.
Solution:   Properly check for existing command. (Higashi Higashi)

src/ex_docmd.c
src/testdir/test_vimscript.vim
src/version.c

index 9dac9bf3a7243c39b04c663062bf2c47130744e0..bdd152dfd7b8c037d986cda2fd767ea7c2480d14 100644 (file)
@@ -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;
index c09e2343b6b00110593cb849e61d2d8a3f12f1a8..c0736f2baab823ab484d64d6129c87b84a0db574 100644 (file)
@@ -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
index 533660fa05048727112e3f34df43e72abe411de3..fd57e48aca22b6cd66721a8b83a2f1839ae3c118 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    656,
 /**/
     655,
 /**/