mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
vim-patch:8.2.2285: Vim9: cannot set an option to a false
Problem: Vim9: cannot set an option to a false.
Solution: For VAR_BOOL use string "0". (closes vim/vim#7603)
b0d8182fa3
This commit is contained in:
@@ -1571,10 +1571,11 @@ static void set_option_from_tv(const char *varname, typval_T *varp)
|
|||||||
|
|
||||||
if (varp->v_type == VAR_BOOL) {
|
if (varp->v_type == VAR_BOOL) {
|
||||||
numval = (long)varp->vval.v_number;
|
numval = (long)varp->vval.v_number;
|
||||||
|
strval = "0"; // avoid using "false"
|
||||||
} else {
|
} else {
|
||||||
numval = (long)tv_get_number_chk(varp, &error);
|
numval = (long)tv_get_number_chk(varp, &error);
|
||||||
|
strval = tv_get_string_buf_chk(varp, nbuf);
|
||||||
}
|
}
|
||||||
strval = tv_get_string_buf_chk(varp, nbuf);
|
|
||||||
if (!error && strval != NULL) {
|
if (!error && strval != NULL) {
|
||||||
set_option_value(varname, numval, strval, OPT_LOCAL);
|
set_option_value(varname, numval, strval, OPT_LOCAL);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user