Skip to content

Commit f96e9de

Browse files
committed
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 #6608)
1 parent 8314454 commit f96e9de

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/eval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ eval_expr_typval(typval_T *expr, typval_T *argv, int argc, typval_T *rettv)
300300
s = skipwhite(s);
301301
if (eval1_emsg(&s, rettv, NULL) == FAIL)
302302
return FAIL;
303-
if (*s != NUL) // check for trailing chars after expr
303+
if (*skipwhite(s) != NUL) // check for trailing chars after expr
304304
{
305305
clear_tv(rettv);
306306
semsg(_(e_invexpr2), s);

src/testdir/test_filter_map.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ func Test_filter_map_list_expr_string()
1111
call assert_equal([2, 4, 6, 8], map([1, 2, 3, 4], 'v:val * 2'))
1212
call assert_equal([0, 2, 4, 6], map([1, 2, 3, 4], 'v:key * 2'))
1313
call assert_equal([9, 9, 9, 9], map([1, 2, 3, 4], 9))
14+
call assert_equal([7, 7, 7], map([1, 2, 3], ' 7 '))
1415
endfunc
1516

1617
" dict with expression string

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ static char *(features[]) =
754754

755755
static int included_patches[] =
756756
{ /* Add new patch number below this line */
757+
/**/
758+
1360,
757759
/**/
758760
1359,
759761
/**/

0 commit comments

Comments
 (0)