Skip to content

Commit df749a2

Browse files
committed
patch 8.2.2669: command line completion does not work after "vim9"
Problem: Command line completion does not work after "vim9". Solution: Include the "9". (Naohiro Ono, closes #8025)
1 parent f49a1fc commit df749a2

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/cmdexpand.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,8 +1020,9 @@ set_one_cmd_context(
10201020
p = cmd;
10211021
while (ASCII_ISALPHA(*p) || *p == '*') // Allow * wild card
10221022
++p;
1023-
// a user command may contain digits
1024-
if (ASCII_ISUPPER(cmd[0]))
1023+
// A user command may contain digits.
1024+
// Include "9" for "vim9*" commands; "vim9cmd" and "vim9script".
1025+
if (ASCII_ISUPPER(cmd[0]) || STRNCMP("vim9", cmd, 4) == 0)
10251026
while (ASCII_ISALNUM(*p) || *p == '*')
10261027
++p;
10271028
// for python 3.x: ":py3*" commands completion

src/ex_docmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3553,7 +3553,7 @@ find_ex_command(
35533553
}
35543554
else if (*p == '9' && STRNCMP("vim9", eap->cmd, 4) == 0)
35553555
{
3556-
// include "9" for "vim9script"
3556+
// include "9" for "vim9*" commands; "vim9cmd" and "vim9script".
35573557
++p;
35583558
while (ASCII_ISALPHA(*p))
35593559
++p;

src/testdir/test_cmdline.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,10 @@ func Test_cmdline_complete_various()
871871
call feedkeys(":py3\<C-A>\<C-B>\"\<CR>", 'xt')
872872
call assert_equal('"py3 py3do py3file', @:)
873873

874+
" completion for the :vim9 commands
875+
call feedkeys(":vim9\<C-A>\<C-B>\"\<CR>", 'xt')
876+
call assert_equal('"vim9cmd vim9script', @:)
877+
874878
" redir @" is not the start of a comment. So complete after that
875879
call feedkeys(":redir @\" | cwin\t\<C-B>\"\<CR>", 'xt')
876880
call assert_equal('"redir @" | cwindow', @:)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2669,
753755
/**/
754756
2668,
755757
/**/

0 commit comments

Comments
 (0)