]> granicus.if.org Git - vim/commitdiff
patch 8.2.1923: Vim9: "filter" command modifier doesn't work v8.2.1923
authorBram Moolenaar <Bram@vim.org>
Thu, 29 Oct 2020 19:24:34 +0000 (20:24 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 29 Oct 2020 19:24:34 +0000 (20:24 +0100)
Problem:    Vim9: "filter" command modifier doesn't work.
Solution:   Check for space on char before argument. (closes #7216,
            closes #7222)

src/ex_docmd.c
src/testdir/test_vim9_cmd.vim
src/version.c

index b8ee85c76e912ef8bbc9233567785fb8ce869fc5..48da263df03a20c366ea5d8c8f3460f34bc3054b 100644 (file)
@@ -2763,7 +2763,7 @@ parse_command_modifiers(
                            }
 #ifdef FEAT_EVAL
                            // Avoid that "filter(arg)" is recognized.
-                           if (in_vim9script() && !VIM_ISWHITE(*p))
+                           if (in_vim9script() && !VIM_ISWHITE(p[-1]))
                                break;
 #endif
                            if (skip_only)
index 710cd2f8dcb606952b9155ec30effee457f34f10..61c47b85f94aa631a3418fdc9193497f5e698701 100644 (file)
@@ -312,6 +312,18 @@ def Test_filter_is_not_modifier()
   assert_equal([#{x: 3, y: 4}], tags)
 enddef
 
+def Test_filter_is_recognized()
+  var lines =<< trim END
+    final expected = "\nType Name Content\n  c  \"c   piyo"
+    @a = 'hoge'
+    @b = 'fuga'
+    @c = 'piyo'
+
+    assert_equal(execute('filter /piyo/ registers abc'), expected)
+  END
+  CheckDefAndScriptSuccess(lines)
+enddef
+
 def Test_eval_command()
   var from = 3
   var to = 5
index 4e1d570a7ea84ca7fdd447d37ba0e218c8a73a94..52d868398466e083fffeeaec6b7e33309f6ff6ed 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1923,
 /**/
     1922,
 /**/