comparison src/testdir/test_vim9_cmd.vim @ 21255:4be91a7eafb2 v8.2.1178

patch 8.2.1178: Vim9: filter function recognized as command modifier Commit: https://github.com/vim/vim/commit/b074e8b8d4d3cefefc675dfaf3982d388ee07772 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 11 13:40:45 2020 +0200 patch 8.2.1178: Vim9: filter function recognized as command modifier 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)
author Bram Moolenaar <Bram@vim.org>
date Sat, 11 Jul 2020 13:45:04 +0200
parents 874a28fac941
children f19ac9b8b011
comparison
equal deleted inserted replaced
21254:44f3da90b7bc 21255:4be91a7eafb2
261 enddef 261 enddef
262 ReadFromShell() 262 ReadFromShell()
263 assert_equal(['hello there', 'again'], readfile('Xoutfile')) 263 assert_equal(['hello there', 'again'], readfile('Xoutfile'))
264 delete('Xoutfile') 264 delete('Xoutfile')
265 endif 265 endif
266 enddef
267
268 def Test_filter_is_not_modifier()
269 let tags = [{'a': 1, 'b': 2}, {'x': 3, 'y': 4}]
270 filter(tags, { _, v -> has_key(v, 'x') ? 1 : 0 })
271 assert_equal([#{x: 3, y: 4}], tags)
266 enddef 272 enddef
267 273
268 def Test_eval_command() 274 def Test_eval_command()
269 let from = 3 275 let from = 3
270 let to = 5 276 let to = 5