diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-25 17:20:23 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-25 18:20:47 +0800 |
commit | 963ea726daf3e19279f8e24b48116f11f1921c7d (patch) | |
tree | bd70892f3ef31a0c71dd767dc2a502211eab3c64 /src | |
parent | 8921035fc762d39f42f1b644a19a78d36fbda87a (diff) | |
download | rneovim-963ea726daf3e19279f8e24b48116f11f1921c7d.tar.gz rneovim-963ea726daf3e19279f8e24b48116f11f1921c7d.tar.bz2 rneovim-963ea726daf3e19279f8e24b48116f11f1921c7d.zip |
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)
https://github.com/vim/vim/commit/b0d8182fa39f2c9403f5f9a0663589fcab43a6c8
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval/vars.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c index 40a3707060..a0141402bc 100644 --- a/src/nvim/eval/vars.c +++ b/src/nvim/eval/vars.c @@ -1571,10 +1571,11 @@ static void set_option_from_tv(const char *varname, typval_T *varp) if (varp->v_type == VAR_BOOL) { numval = (long)varp->vval.v_number; + strval = "0"; // avoid using "false" } else { 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) { set_option_value(varname, numval, strval, OPT_LOCAL); } |