Mercurial > vim
changeset 22750:f945413264d7 v8.2.1923
patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Commit: https://github.com/vim/vim/commit/4f6b6ed208a15552f0eb7f27b7ca945f59f22c1d
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 29 20:24:34 2020 +0100
patch 8.2.1923: Vim9: "filter" command modifier doesn't work
Problem: Vim9: "filter" command modifier doesn't work.
Solution: Check for space on char before argument. (closes https://github.com/vim/vim/issues/7216,
closes #7222)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 29 Oct 2020 20:30:04 +0100 |
parents | 9ba58f7e5ae2 |
children | f9f8ec2acdea |
files | src/ex_docmd.c src/testdir/test_vim9_cmd.vim src/version.c |
diffstat | 3 files changed, 15 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -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)
--- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -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