summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-11 13:40:45 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-11 13:40:45 +0200
commitb074e8b8d4d3cefefc675dfaf3982d388ee07772 (patch)
tree36f1a96ee38e8df6a0db999d886f88f613deee0d /src/ex_docmd.c
parent18aa13d13b69c090dbe186cd4939896488c433e3 (diff)
patch 8.2.1178: Vim9: filter function recognized as command modifierv8.2.1178
Problem: Vim9: filter function recognized as command modifier, leading to a crash. Solution: Clear cmdmod after freeing items. Do not recognize a command modifier followed by non-white space. (closes #6434)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 0573897b7c..692192bb18 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2750,6 +2750,10 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
if (*p == NUL || ends_excmd(*p))
break;
}
+ // Avoid that "filter(arg)" is recognized.
+ if (in_vim9script() && !VIM_ISWHITE(*p))
+ break;
+
if (skip_only)
p = skip_vimgrep_pat(p, NULL, NULL);
else
@@ -2904,7 +2908,7 @@ parse_command_modifiers(exarg_T *eap, char **errormsg, int skip_only)
}
/*
- * Unod and free contents of "cmdmod".
+ * Undo and free contents of "cmdmod".
*/
void
undo_cmdmod(exarg_T *eap, int save_msg_scroll)