From df749a2b9cab579b8c0ca6ca91889aa03d2da704 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 28 Mar 2021 15:29:43 +0200 Subject: 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) --- src/cmdexpand.c | 5 +++-- src/ex_docmd.c | 2 +- src/testdir/test_cmdline.vim | 4 ++++ src/version.c | 2 ++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/cmdexpand.c b/src/cmdexpand.c index d51f5c6428..280b9e415c 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -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 diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 7a03597213..b4e35537d7 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -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; diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 05d90f74d1..531837b223 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -871,6 +871,10 @@ func Test_cmdline_complete_various() call feedkeys(":py3\\\"\", 'xt') call assert_equal('"py3 py3do py3file', @:) + " completion for the :vim9 commands + call feedkeys(":vim9\\\"\", 'xt') + call assert_equal('"vim9cmd vim9script', @:) + " redir @" is not the start of a comment. So complete after that call feedkeys(":redir @\" | cwin\t\\"\", 'xt') call assert_equal('"redir @" | cwindow', @:) diff --git a/src/version.c b/src/version.c index 716f41ea72..00d2fd74a3 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2669, /**/ 2668, /**/ -- cgit v1.2.3