diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 362bbc2b4a..41ad77f53f 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -4451,7 +4451,6 @@ skip_range( int *ctx) // pointer to xp_context or NULL { char_u *cmd = cmd_start; - unsigned delim; while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;\\", *cmd) != NULL) { @@ -4480,10 +4479,7 @@ skip_range( } else if (*cmd == '/' || *cmd == '?') { - delim = *cmd++; - while (*cmd != NUL && *cmd != delim) - if (*cmd++ == '\\' && *cmd != NUL) - ++cmd; + cmd = skip_regexp(cmd + 1, *cmd, magic_isset()); if (*cmd == NUL && ctx != NULL) *ctx = EXPAND_NOTHING; } diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 3fdb89e17c..62639f873b 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -1545,6 +1545,12 @@ func Test_cmdline_complete_various() call feedkeys(":1,2\"\\\"\", 'xt') call assert_equal("\"1,2\"\", @:) + " completion for command after a pattern address (containing delimiter) + call feedkeys(":/foo[/]bar\\/baz/num\\\"\", 'xt') + call assert_equal("\"/foo[/]bar\\/baz/number", @:) + call feedkeys(":?foo[?]bar\\?baz?num\\\"\", 'xt') + call assert_equal("\"?foo[?]bar\\?baz?number", @:) + " completion for :k command call feedkeys(":ka\\\"\", 'xt') call assert_equal("\"ka\", @:) @@ -2684,6 +2690,18 @@ func Test_zero_line_search() q! endfunc +func Test_pattern_address_with_command() + new + call setline(1, ["one", "two - foo/bar/baz", "three - foo?bar?baz", "four"]) + call cursor(1, 1) + :/foo[/]bar\/baz/print + call assert_equal("two - foo/bar/baz", getline('.')) + call cursor("$", 1) + :?foo[?]bar\?baz?print + call assert_equal("three - foo?bar?baz", getline('.')) + bwipe! +endfunc + func Test_read_shellcmd() CheckUnix if executable('ls') diff --git a/src/version.c b/src/version.c index 4e3ff960d9..4db2c5564a 100644 --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1230, /**/ 1229, /**/