Bram,
when running `:let &option.=10` this correctly gives E734, but at the 
same time overwrites option to be '10'. I think this is wrong. So please 
include the attached patch.

Christian
-- 
Außer der Einsamkeit macht nichts so stolz als eine Gesellschaft, die
sich immer untereinander lobt.
                -- Jean Paul

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
From 6e13bf077fb400a4dd0bd95ce36912d420a1b662 Mon Sep 17 00:00:00 2001
From: Christian Brabandt <[email protected]>
Date: Mon, 2 Oct 2017 10:25:46 +0200
Subject: [PATCH] do not overwrite option when :let &option fails

Currently, if `:let &option.="foobar" causes E734,
the option value will still be silently overwritten.

Since this does already cause an error, the old option value shouldn't
be overwritten but be kept. Verify this behaviour with a new test.
---
 src/eval.c                  |  4 ++++
 src/testdir/test_assign.vim | 20 ++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/src/eval.c b/src/eval.c
index 8b1ceaea8..b40ccbee6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1704,7 +1704,11 @@ ex_let_one(
 						       &stringval, opt_flags);
 		if ((opt_type == 1 && *op == '.')
 			|| (opt_type == 0 && *op != '.'))
+		{
 		    EMSG2(_(e_letwrong), op);
+		    /* do not overwrite the current option value */
+		    s = NULL;
+		}
 		else
 		{
 		    if (opt_type == 1)  /* number */
diff --git a/src/testdir/test_assign.vim b/src/testdir/test_assign.vim
index efc9d086b..282b33efa 100644
--- a/src/testdir/test_assign.vim
+++ b/src/testdir/test_assign.vim
@@ -29,3 +29,23 @@ 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
+  try
+    let &tw.=1
+  catch
+  endtry
+  call assert_equal(80, &tw)
+  let &tw=_w
+  unlet! _w
+  let _w = &fillchars
+  let &fillchars="vert:|"
+  try
+    let &fillchars+="diff:-"
+  catch
+  endtry
+  call assert_equal("vert:|", &fillchars)
+  let &fillchars=_w
+endfunc
-- 
2.14.1

Raspunde prin e-mail lui