From 037f5320767060d33c2b12cad17eefdeec66002a Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 4 Aug 2020 22:12:28 -0400 Subject: vim-patch:8.2.1361: error for white space after expression in assignment Problem: Error for white space after expression in assignment. Solution: Skip over white space. (closes vim/vim#6617) https://github.com/vim/vim/commit/6a25026262e2cdbbd8738361c5bd6ebef8862d87 --- src/nvim/eval.c | 1 + src/nvim/testdir/test_expr.vim | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src/nvim') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index df8b765c1c..3ab50878a8 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -2086,6 +2086,7 @@ char_u *get_lval(char_u *const name, typval_T *const rettv, tv_clear(&var1); return NULL; } + p = skipwhite(p); } // Optionally get the second index [ :expr]. diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index 264d8b000f..b8d6f5aa7d 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -49,6 +49,9 @@ func Test_dict() let d['a'] = 'aaa' call assert_equal('none', d['']) call assert_equal('aaa', d['a']) + + let d[ 'b' ] = 'bbb' + call assert_equal('bbb', d[ 'b' ]) endfunc func Test_strgetchar() -- cgit