diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-09-14 16:37:34 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-09-14 16:37:34 +0200 |
commit | 3bd8de40b484d3617a19092d3cc036f8b4f3d51c (patch) | |
tree | b0ec9e16a8cfc27719141e162dce6fd7510266f5 /src/ex_docmd.c | |
parent | d1f76afaf963be706697279ab0570ffcb8a1f2fc (diff) |
patch 8.2.1679: Vim9: ":*" is not recognized as a rangev8.2.1679
Problem: Vim9: ":*" is not recognized as a range.
Solution: Move recognizing "*" into skip_range(). (closes #6838)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 6495db6e83..ed52b464be 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -1779,9 +1779,7 @@ do_one_cmd( may_have_range = !vim9script || starts_with_colon; if (may_have_range) #endif - ea.cmd = skip_range(ea.cmd, NULL); - if (*ea.cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL) - ea.cmd = skipwhite(ea.cmd + 1); + ea.cmd = skip_range(ea.cmd, TRUE, NULL); #ifdef FEAT_EVAL if (vim9script && !starts_with_colon) @@ -2683,7 +2681,7 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only) return FAIL; } - p = skip_range(eap->cmd, NULL); + p = skip_range(eap->cmd, TRUE, NULL); switch (*p) { // When adding an entry, also modify cmd_exists(). @@ -3534,7 +3532,8 @@ excmd_get_argt(cmdidx_T idx) char_u * skip_range( char_u *cmd, - int *ctx) // pointer to xp_context or NULL + int skip_star, // skip "*" used for Visual range + int *ctx) // pointer to xp_context or NULL { unsigned delim; @@ -3569,6 +3568,10 @@ skip_range( while (*cmd == ':') cmd = skipwhite(cmd + 1); + // Skip "*" used for Visual range. + if (skip_star && *cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL) + cmd = skipwhite(cmd + 1); + return cmd; } |