commit 8d3742ae8da4988f073be29b42dbee401c19f8f7
parent 2b766e1f4d51f0bd435005a7ee9e2e25245a7987
Author: Rob Pilling <robpilling@gmail.com>
Date: Mon, 22 Dec 2025 08:49:57 +0000
vim-patch:8.2.1679: ":*" is not recognized as a range (#37052)
Problem: Vim9: ":*" is not recognized as a range.
Solution: Move recognizing "*" into skip_range(). (closes vim/vim#6938)
https://github.com/vim/vim/commit/3bd8de40b484d3617a19092d3cc036f8b4f3d51c
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
@@ -1488,9 +1488,6 @@ static char *find_excmd_after_range(exarg_T *eap)
// Save location after command modifiers.
char *cmd = eap->cmd;
eap->cmd = skip_range(eap->cmd, NULL);
- if (*eap->cmd == '*') {
- eap->cmd = skipwhite(eap->cmd + 1);
- }
char *p = find_ex_command(eap, NULL);
eap->cmd = cmd; // Restore original position for address parsing
return p;
@@ -3422,6 +3419,11 @@ char *skip_range(const char *cmd, int *ctx)
// Skip ":" and white space.
cmd = skip_colon_white(cmd, false);
+ // Skip "*" used for Visual range.
+ if (*cmd == '*') {
+ cmd = skipwhite(cmd + 1);
+ }
+
return (char *)cmd;
}