Skip to content

Commit

Permalink
patch 8.2.3690: Vim9: "filter #pat# cmd" does not work
Browse files Browse the repository at this point in the history
Problem:    Vim9: "filter #pat# cmd" does not work.
Solution:   Do not see #pat# as a comment.
  • Loading branch information
brammool committed Nov 28, 2021
1 parent 3ccb579 commit 06bffe8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ex_docmd.c
Expand Up @@ -2910,7 +2910,14 @@ parse_command_modifiers(
int c = 0;

if (!checkforcmd_noparen(&p, "filter", 4)
|| *p == NUL || ends_excmd(*p))
|| *p == NUL
|| (ends_excmd(*p)
#ifdef FEAT_EVAL
// in ":filter #pat# cmd" # does not
// start a comment
&& (!in_vim9script() || VIM_ISWHITE(p[1]))
#endif
))
break;
if (*p == '!')
{
Expand Down
10 changes: 10 additions & 0 deletions src/testdir/test_vim9_cmd.vim
Expand Up @@ -714,6 +714,16 @@ def Test_command_modifier_filter()
assert_match('very specific z3d37dh234 string', Screenline(&lines))
END
CheckDefAndScriptSuccess(lines)

lines =<< trim END
edit foobar
redir => g:filter_out
filter #foobar# ls
redir END
assert_match('"foobar"', g:filter_out)
unlet g:filter_out
END
CheckDefAndScriptSuccess(lines)
enddef

def Test_win_command_modifiers()
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -757,6 +757,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3690,
/**/
3689,
/**/
Expand Down

0 comments on commit 06bffe8

Please sign in to comment.