mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.1172: when E734 is given option is still set (#8988)
Problem: When E734 is given option is still set.
Solution: Assign NULL to "s". (Christian Brabandt)
2a6a6c3014
This commit is contained in:
parent
d5702a4534
commit
ea5337d9b5
@ -1912,6 +1912,7 @@ static char_u *ex_let_one(char_u *arg, typval_T *const tv,
|
|||||||
if ((opt_type == 1 && *op == '.')
|
if ((opt_type == 1 && *op == '.')
|
||||||
|| (opt_type == 0 && *op != '.')) {
|
|| (opt_type == 0 && *op != '.')) {
|
||||||
EMSG2(_(e_letwrong), op);
|
EMSG2(_(e_letwrong), op);
|
||||||
|
s = NULL; // don't set the value
|
||||||
} else {
|
} else {
|
||||||
if (opt_type == 1) { // number
|
if (opt_type == 1) { // number
|
||||||
if (*op == '+') {
|
if (*op == '+') {
|
||||||
|
@ -31,3 +31,17 @@ func Test_let_termcap()
|
|||||||
let &t_xx = ""
|
let &t_xx = ""
|
||||||
call assert_fails('let x = &t_xx', 'E15')
|
call assert_fails('let x = &t_xx', 'E15')
|
||||||
endfunc
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user