Skip to content

Commit 2a6a6c3

Browse files
committed
patch 8.0.1172: when E734 is given option is still set
Problem: When E734 is given option is still set. Solution: Assign NULL to "s". (Christian Brabandt)
1 parent 712549e commit 2a6a6c3

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/eval.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,10 @@ ex_let_one(
17041704
&stringval, opt_flags);
17051705
if ((opt_type == 1 && *op == '.')
17061706
|| (opt_type == 0 && *op != '.'))
1707+
{
17071708
EMSG2(_(e_letwrong), op);
1709+
s = NULL; /* don't set the value */
1710+
}
17081711
else
17091712
{
17101713
if (opt_type == 1) /* number */

src/testdir/test_assign.vim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,17 @@ func Test_let_termcap()
2929
let &t_xx = ""
3030
call assert_fails('let x = &t_xx', 'E15')
3131
endfunc
32+
33+
func Test_let_option_error()
34+
let _w = &tw
35+
let &tw = 80
36+
call assert_fails('let &tw .= 1', 'E734')
37+
call assert_equal(80, &tw)
38+
let &tw = _w
39+
40+
let _w = &fillchars
41+
let &fillchars = "vert:|"
42+
call assert_fails('let &fillchars += "diff:-"', 'E734')
43+
call assert_equal("vert:|", &fillchars)
44+
let &fillchars = _w
45+
endfunc

src/version.c

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

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1172,
764766
/**/
765767
1171,
766768
/**/

0 commit comments

Comments
 (0)