summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-06-06 21:38:09 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-06 21:38:09 +0200
commite729ce294f9756165020ad86e3b98b4112e1a6ab (patch)
tree9bfd11d59b2a6e1592dc7ee8dc8a7f4d943631ac /src/ex_cmds.c
parent6db7b6375a3ea3afef5295b1366896902012e640 (diff)
patch 8.2.2955: Vim9: using filter in compiled command does not workv8.2.2955
Problem: Vim9: using filter in compiled command does not work. Solution: Generate EXEC including the command modifier.
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index e1497a5a4a..614d41d69f 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -5278,6 +5278,16 @@ ex_drop(exarg_T *eap)
char_u *
skip_vimgrep_pat(char_u *p, char_u **s, int *flags)
{
+ return skip_vimgrep_pat_ext(p, s, flags, NULL, NULL);
+}
+
+/*
+ * As skip_vimgrep_pat() and store the character overwritten by NUL in "cp"
+ * and the pointer to it in "nulp".
+ */
+ char_u *
+skip_vimgrep_pat_ext(char_u *p, char_u **s, int *flags, char_u **nulp, int *cp)
+{
int c;
if (vim_isIDc(*p))
@@ -5287,7 +5297,14 @@ skip_vimgrep_pat(char_u *p, char_u **s, int *flags)
*s = p;
p = skiptowhite(p);
if (s != NULL && *p != NUL)
+ {
+ if (nulp != NULL)
+ {
+ *nulp = p;
+ *cp = *p;
+ }
*p++ = NUL;
+ }
}
else
{
@@ -5301,7 +5318,14 @@ skip_vimgrep_pat(char_u *p, char_u **s, int *flags)
// Truncate the pattern.
if (s != NULL)
+ {
+ if (nulp != NULL)
+ {
+ *nulp = p;
+ *cp = *p;
+ }
*p = NUL;
+ }
++p;
// Find the flags