diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-07-11 13:40:45 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-07-11 13:40:45 +0200 |
commit | b074e8b8d4d3cefefc675dfaf3982d388ee07772 (patch) | |
tree | 36f1a96ee38e8df6a0db999d886f88f613deee0d /src/testdir | |
parent | 18aa13d13b69c090dbe186cd4939896488c433e3 (diff) | |
download | vim-git-b074e8b8d4d3cefefc675dfaf3982d388ee07772.tar.gz |
patch 8.2.1178: Vim9: filter function recognized as command modifierv8.2.1178
Problem: Vim9: filter function recognized as command modifier, leading to a
crash.
Solution: Clear cmdmod after freeing items. Do not recognize a command
modifier followed by non-white space. (closes #6434)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_vim9_cmd.vim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_cmd.vim b/src/testdir/test_vim9_cmd.vim index 801404d9c..676e97ceb 100644 --- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -265,6 +265,12 @@ def Test_bar_after_command() endif enddef +def Test_filter_is_not_modifier() + let tags = [{'a': 1, 'b': 2}, {'x': 3, 'y': 4}] + filter(tags, { _, v -> has_key(v, 'x') ? 1 : 0 }) + assert_equal([#{x: 3, y: 4}], tags) +enddef + def Test_eval_command() let from = 3 let to = 5 |