mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.1679: Vim9: ":*" is not recognized as a range
Problem: Vim9: ":*" is not recognized as a range. Solution: Move recognizing "*" into skip_range(). (closes #6838)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user