]> granicus.if.org Git - vim/commitdiff
patch 8.0.1172: when E734 is given option is still set v8.0.1172
authorBram Moolenaar <Bram@vim.org>
Mon, 2 Oct 2017 17:29:48 +0000 (19:29 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 2 Oct 2017 17:29:48 +0000 (19:29 +0200)
Problem:    When E734 is given option is still set.
Solution:   Assign NULL to "s". (Christian Brabandt)

src/eval.c
src/testdir/test_assign.vim
src/version.c

index 8b1ceaea80c8ee98b314380dc3788a98485cf5d2..8670e124032bc7e0516e88d36ac21f565c263f02 100644 (file)
@@ -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 */
index efc9d086be9fa62c360216349b92e5f10da097ac..317d45867f0626aa6e2112e9ad75f99d9c1fcb73 100644 (file)
@@ -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
index 925a6cd616a3edb12969dedf9f8a5eff734dd750..6e3f90a37eaa1c24a517c819d8b96f295e8642a9 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1172,
 /**/
     1171,
 /**/