@@ -1779,9 +1779,7 @@ do_one_cmd(
17791779 may_have_range = !vim9script || starts_with_colon ;
17801780 if (may_have_range )
17811781#endif
1782- ea .cmd = skip_range (ea .cmd , NULL );
1783- if (* ea .cmd == '*' && vim_strchr (p_cpo , CPO_STAR ) == NULL )
1784- ea .cmd = skipwhite (ea .cmd + 1 );
1782+ ea .cmd = skip_range (ea .cmd , TRUE, NULL );
17851783
17861784#ifdef FEAT_EVAL
17871785 if (vim9script && !starts_with_colon )
@@ -2683,7 +2681,7 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
26832681 return FAIL ;
26842682 }
26852683
2686- p = skip_range (eap -> cmd , NULL );
2684+ p = skip_range (eap -> cmd , TRUE, NULL );
26872685 switch (* p )
26882686 {
26892687 // When adding an entry, also modify cmd_exists().
@@ -3534,7 +3532,8 @@ excmd_get_argt(cmdidx_T idx)
35343532 char_u *
35353533skip_range (
35363534 char_u * cmd ,
3537- int * ctx ) // pointer to xp_context or NULL
3535+ int skip_star , // skip "*" used for Visual range
3536+ int * ctx ) // pointer to xp_context or NULL
35383537{
35393538 unsigned delim ;
35403539
@@ -3569,6 +3568,10 @@ skip_range(
35693568 while (* cmd == ':' )
35703569 cmd = skipwhite (cmd + 1 );
35713570
3571+ // Skip "*" used for Visual range.
3572+ if (skip_star && * cmd == '*' && vim_strchr (p_cpo , CPO_STAR ) == NULL )
3573+ cmd = skipwhite (cmd + 1 );
3574+
35723575 return cmd ;
35733576}
35743577
0 commit comments