]> granicus.if.org Git - vim/commitdiff
patch 8.2.2991: Vim9: no completion for :vim9 and :legacy v8.2.2991
authorBram Moolenaar <Bram@vim.org>
Sun, 13 Jun 2021 15:20:08 +0000 (17:20 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 13 Jun 2021 15:20:08 +0000 (17:20 +0200)
Problem:    Vim9: no completion for :vim9 and :legacy.
Solution:   Expand argument as a command. (closes #8377)

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

index c5b8f70585e88ab4e8c42558109b9f584aa90bb3..ba31e928c0dbc5c886b080cd8b7f24b85bd71122 100644 (file)
@@ -1370,6 +1370,8 @@ set_one_cmd_context(
        case CMD_verbose:
        case CMD_vertical:
        case CMD_windo:
+       case CMD_vim9cmd:
+       case CMD_legacy:
            return arg;
 
        case CMD_filter:
index cf3362d63eac8902e2d3261b0ef1e5e22697f512..a05d010d4409639ca098d80180e80401f7549764 100644 (file)
@@ -804,6 +804,12 @@ func Test_cmdline_complete_various()
   call feedkeys(":topleft new\<C-A>\<C-B>\"\<CR>", 'xt')
   call assert_equal("\"topleft new", @:)
 
+  " completion for vim9 and legacy commands
+  call feedkeys(":vim9 call strle\<C-A>\<C-B>\"\<CR>", 'xt')
+  call assert_equal("\"vim9 call strlen(", @:)
+  call feedkeys(":legac call strle\<C-A>\<C-B>\"\<CR>", 'xt')
+  call assert_equal("\"legac call strlen(", @:)
+
   " completion for the :match command
   call feedkeys(":match Search /pat/\<C-A>\<C-B>\"\<CR>", 'xt')
   call assert_equal("\"match Search /pat/\<C-A>", @:)
index dfe1f8b1fb83db7e0e6fc3461897820ce83a4a7d..07c775b41b49965c025c083665f993a5581609df 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2991,
 /**/
     2990,
 /**/