aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-08-04 22:02:41 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-08-14 18:20:28 -0400
commit9abfb852647066d87b3a0f7caa63ca991987ecd7 (patch)
tree433b3b890eb42c2b2b360603a85cbfe1276a7d2a
parent7a047d8dc2dff4078649290696b3e507aaaf8f04 (diff)
downloadrneovim-9abfb852647066d87b3a0f7caa63ca991987ecd7.tar.gz
rneovim-9abfb852647066d87b3a0f7caa63ca991987ecd7.tar.bz2
rneovim-9abfb852647066d87b3a0f7caa63ca991987ecd7.zip
vim-patch:8.2.1360: stray error for white space after expression
Problem: Stray error for white space after expression. Solution: Ignore trailing white space. (closes vim/vim#6608) https://github.com/vim/vim/commit/f96e9dec636d7d105b015680d8c5d6b47d936e01
-rw-r--r--src/nvim/eval.c2
-rw-r--r--src/nvim/testdir/test_filter_map.vim1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 0cad5fd6c1..df8b765c1c 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -760,7 +760,7 @@ int eval_expr_typval(const typval_T *expr, typval_T *argv,
if (eval1_emsg(&s, rettv, true) == FAIL) {
return FAIL;
}
- if (*s != NUL) { // check for trailing chars after expr
+ if (*skipwhite(s) != NUL) { // check for trailing chars after expr
tv_clear(rettv);
emsgf(_(e_invexpr2), s);
return FAIL;
diff --git a/src/nvim/testdir/test_filter_map.vim b/src/nvim/testdir/test_filter_map.vim
index 1dd3a5b29f..a15567bcf2 100644
--- a/src/nvim/testdir/test_filter_map.vim
+++ b/src/nvim/testdir/test_filter_map.vim
@@ -11,6 +11,7 @@ func Test_filter_map_list_expr_string()
call assert_equal([2, 4, 6, 8], map([1, 2, 3, 4], 'v:val * 2'))
call assert_equal([0, 2, 4, 6], map([1, 2, 3, 4], 'v:key * 2'))
call assert_equal([9, 9, 9, 9], map([1, 2, 3, 4], 9))
+ call assert_equal([7, 7, 7], map([1, 2, 3], ' 7 '))
endfunc
" dict with expression string