diff options
-rw-r--r-- | src/eval.c | 3 | ||||
-rw-r--r-- | src/testdir/test_assign.vim | 14 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index 8b1ceaea80..8670e12403 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1704,7 +1704,10 @@ ex_let_one( &stringval, opt_flags); if ((opt_type == 1 && *op == '.') || (opt_type == 0 && *op != '.')) + { EMSG2(_(e_letwrong), op); + s = NULL; /* don't set the value */ + } else { if (opt_type == 1) /* number */ diff --git a/src/testdir/test_assign.vim b/src/testdir/test_assign.vim index efc9d086be..317d45867f 100644 --- a/src/testdir/test_assign.vim +++ b/src/testdir/test_assign.vim @@ -29,3 +29,17 @@ func Test_let_termcap() let &t_xx = "" call assert_fails('let x = &t_xx', 'E15') endfunc + +func Test_let_option_error() + let _w = &tw + let &tw = 80 + call assert_fails('let &tw .= 1', 'E734') + call assert_equal(80, &tw) + let &tw = _w + + let _w = &fillchars + let &fillchars = "vert:|" + call assert_fails('let &fillchars += "diff:-"', 'E734') + call assert_equal("vert:|", &fillchars) + let &fillchars = _w +endfunc diff --git a/src/version.c b/src/version.c index 925a6cd616..6e3f90a37e 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1172, +/**/ 1171, /**/ 1170, |