diff options
Diffstat (limited to 'src/cmdexpand.c')
-rw-r--r-- | src/cmdexpand.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c index cc34f296a8..5a47f6a24a 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -1850,21 +1850,22 @@ find_cmd_after_substitute_cmd(char_u *arg) find_cmd_after_isearch_cmd(expand_T *xp, char_u *arg) { arg = skipwhite(skipdigits(arg)); // skip count - if (*arg == '/') // Match regexp, not just whole words + if (*arg != '/') + return NULL; + + // Match regexp, not just whole words + for (++arg; *arg && *arg != '/'; arg++) + if (*arg == '\\' && arg[1] != NUL) + arg++; + if (*arg) { - for (++arg; *arg && *arg != '/'; arg++) - if (*arg == '\\' && arg[1] != NUL) - arg++; - if (*arg) - { - arg = skipwhite(arg + 1); + arg = skipwhite(arg + 1); - // Check for trailing illegal characters - if (*arg == NUL || vim_strchr((char_u *)"|\"\n", *arg) == NULL) - xp->xp_context = EXPAND_NOTHING; - else - return arg; - } + // Check for trailing illegal characters + if (*arg == NUL || vim_strchr((char_u *)"|\"\n", *arg) == NULL) + xp->xp_context = EXPAND_NOTHING; + else + return arg; } return NULL; @@ -2780,7 +2781,7 @@ get_breakadd_arg(expand_T *xp UNUSED, int idx) { char *opts[] = {"expr", "file", "func", "here"}; - if (idx >=0 && idx <= 3) + if (idx >= 0 && idx <= 3) { // breakadd {expr, file, func, here} if (breakpt_expand_what == EXP_BREAKPT_ADD) |