]> granicus.if.org Git - vim/commitdiff
patch 8.2.2669: command line completion does not work after "vim9" v8.2.2669
authorBram Moolenaar <Bram@vim.org>
Sun, 28 Mar 2021 13:29:43 +0000 (15:29 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 28 Mar 2021 13:29:43 +0000 (15:29 +0200)
Problem:    Command line completion does not work after "vim9".
Solution:   Include the "9". (Naohiro Ono, closes #8025)

src/cmdexpand.c
src/ex_docmd.c
src/testdir/test_cmdline.vim
src/version.c

index d51f5c6428de09f606c0140ebd54493958f6a94a..280b9e415cb779157a8e9c8dad55be622232f7f1 100644 (file)
@@ -1020,8 +1020,9 @@ set_one_cmd_context(
        p = cmd;
        while (ASCII_ISALPHA(*p) || *p == '*')    // Allow * wild card
            ++p;
-       // a user command may contain digits
-       if (ASCII_ISUPPER(cmd[0]))
+       // A user command may contain digits.
+       // Include "9" for "vim9*" commands; "vim9cmd" and "vim9script".
+       if (ASCII_ISUPPER(cmd[0]) || STRNCMP("vim9", cmd, 4) == 0)
            while (ASCII_ISALNUM(*p) || *p == '*')
                ++p;
        // for python 3.x: ":py3*" commands completion
index 7a035972137905c4956dae7283a824e7fbc319f8..b4e35537d750ee9c2b897dbae6d70a3bacef7556 100644 (file)
@@ -3553,7 +3553,7 @@ find_ex_command(
        }
        else if (*p == '9' && STRNCMP("vim9", eap->cmd, 4) == 0)
        {
-           // include "9" for "vim9script"
+           // include "9" for "vim9*" commands; "vim9cmd" and "vim9script".
            ++p;
            while (ASCII_ISALPHA(*p))
                ++p;
index 05d90f74d1bc502eb5d20f61e5fb385f4c507a86..531837b2238c2559e0f7845c6cdc532e12c6c056 100644 (file)
@@ -871,6 +871,10 @@ func Test_cmdline_complete_various()
   call feedkeys(":py3\<C-A>\<C-B>\"\<CR>", 'xt')
   call assert_equal('"py3 py3do py3file', @:)
 
+  " completion for the :vim9 commands
+  call feedkeys(":vim9\<C-A>\<C-B>\"\<CR>", 'xt')
+  call assert_equal('"vim9cmd vim9script', @:)
+
   " redir @" is not the start of a comment. So complete after that
   call feedkeys(":redir @\" | cwin\t\<C-B>\"\<CR>", 'xt')
   call assert_equal('"redir @" | cwindow', @:)
index 716f41ea72867a3837002fae3b58c00895e1c7da..00d2fd74a35808753f98cb8c1c66a99e574750fc 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2669,
 /**/
     2668,
 /**/