aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-07-29 21:40:30 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2021-09-15 22:57:55 +0100
commitffaf881b42fd22b8bf423c5754d48ce93f59bf4b (patch)
tree8cf2ac516190973eabfda001275f71e46223c728
parent19232593ba495aa7ac6347b45a9a78d218e6e871 (diff)
downloadrneovim-ffaf881b42fd22b8bf423c5754d48ce93f59bf4b.tar.gz
rneovim-ffaf881b42fd22b8bf423c5754d48ce93f59bf4b.tar.bz2
rneovim-ffaf881b42fd22b8bf423c5754d48ce93f59bf4b.zip
vim-patch:8.2.0829: filter() may give misleading error message
Problem: filter() may give misleading error message. Solution: Also mention Blob as an allowed argument. https://github.com/vim/vim/commit/fcb0b61d15f66f0e9116a6bc56d9d8105bb913cf Rename Test_map_fails() to Test_map_filter_fails() from v8.2.0610 and include the modeline.
-rw-r--r--src/nvim/eval.c2
-rw-r--r--src/nvim/testdir/test_filter_map.vim6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index ba9cb11ed5..26fc02b7c9 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -6393,7 +6393,7 @@ void filter_map(typval_T *argvars, typval_T *rettv, int map)
return;
}
} else {
- EMSG2(_(e_listdictarg), ermsg);
+ EMSG2(_(e_listdictblobarg), ermsg);
return;
}
diff --git a/src/nvim/testdir/test_filter_map.vim b/src/nvim/testdir/test_filter_map.vim
index a15567bcf2..a52a66ac2f 100644
--- a/src/nvim/testdir/test_filter_map.vim
+++ b/src/nvim/testdir/test_filter_map.vim
@@ -81,7 +81,11 @@ func Test_filter_map_dict_expr_funcref()
call assert_equal({"foo": "f", "bar": "b", "baz": "b"}, map(copy(dict), function('s:filter4')))
endfunc
-func Test_map_fails()
+func Test_map_filter_fails()
call assert_fails('call map([1], "42 +")', 'E15:')
call assert_fails('call filter([1], "42 +")', 'E15:')
+ call assert_fails("let l = map('abc', '\"> \" . v:val')", 'E896:')
+ call assert_fails("let l = filter('abc', '\"> \" . v:val')", 'E896:')
endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab