1
0
forked from aniani/vim

patch 8.2.2955: Vim9: using filter in compiled command does not work

Problem:    Vim9: using filter in compiled command does not work.
Solution:   Generate EXEC including the command modifier.
This commit is contained in:
Bram Moolenaar
2021-06-06 21:38:09 +02:00
parent 6db7b6375a
commit e729ce294f
6 changed files with 63 additions and 5 deletions

View File

@@ -2881,7 +2881,9 @@ parse_command_modifiers(
case 'f': // only accept ":filter {pat} cmd"
{
char_u *reg_pat;
char_u *reg_pat;
char_u *nulp = NULL;
int c = 0;
if (!checkforcmd_noparen(&p, "filter", 4)
|| *p == NUL || ends_excmd(*p))
@@ -2902,7 +2904,8 @@ parse_command_modifiers(
p = skip_vimgrep_pat(p, NULL, NULL);
else
// NOTE: This puts a NUL after the pattern.
p = skip_vimgrep_pat(p, &reg_pat, NULL);
p = skip_vimgrep_pat_ext(p, &reg_pat, NULL,
&nulp, &c);
if (p == NULL || *p == NUL)
break;
if (!skip_only)
@@ -2911,6 +2914,9 @@ parse_command_modifiers(
vim_regcomp(reg_pat, RE_MAGIC);
if (cmod->cmod_filter_regmatch.regprog == NULL)
break;
// restore the character overwritten by NUL
if (nulp != NULL)
*nulp = c;
}
eap->cmd = p;
continue;