diff src/ex_docmd.c @ 26319:8b594193dcb6 v8.2.3690

patch 8.2.3690: Vim9: "filter #pat# cmd" does not work Commit: https://github.com/vim/vim/commit/06bffe836c98a65d270579f08004503ffce9931c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Nov 28 20:24:17 2021 +0000 patch 8.2.3690: Vim9: "filter #pat# cmd" does not work Problem: Vim9: "filter #pat# cmd" does not work. Solution: Do not see #pat# as a comment.
author Bram Moolenaar <Bram@vim.org>
date Sun, 28 Nov 2021 21:30:03 +0100
parents 92fbed13ca4d
children 227543e4181f
line wrap: on
line diff
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -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 == '!')
 			    {