diff options
author | Sean Dewar <seandewar@users.noreply.github.com> | 2021-12-25 05:30:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-24 22:30:34 -0700 |
commit | 70a68dc2c5da292124e1c85732cc9228b51adfeb (patch) | |
tree | 3b963f38c46d7e3ee1f8e83b041e2db311d6ca26 /src | |
parent | 0d7a97224f28cdf47d7ecc80b6d300c8c67c0b29 (diff) | |
download | rneovim-70a68dc2c5da292124e1c85732cc9228b51adfeb.tar.gz rneovim-70a68dc2c5da292124e1c85732cc9228b51adfeb.tar.bz2 rneovim-70a68dc2c5da292124e1c85732cc9228b51adfeb.zip |
fix(options): disallow empty 'fdc' and 'scl' (#16765)
Empty string values for these options aren't actually allowed, but
check_opt_strings allows empty string options.
It so happens that 'scl' handles empty string like "auto", but empty 'fdc'
causes glitchiness (win_fdccol_count returns an incorrect value).
Just disallow empty string values for these options completely.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/option.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 04bd968ac8..02e7aeb98b 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -2991,7 +2991,7 @@ ambw_end: } } else if (varp == &curwin->w_p_fdc || varp == &curwin->w_allbuf_opt.wo_fdc) { // 'foldcolumn' - if (check_opt_strings(*varp, p_fdc_values, false) != OK) { + if (**varp == NUL || check_opt_strings(*varp, p_fdc_values, false) != OK) { errmsg = e_invarg; } } else if (varp == &p_pt) { @@ -3370,6 +3370,9 @@ static int int_cmp(const void *a, const void *b) /// @return OK when the value is valid, FAIL otherwise int check_signcolumn(char_u *val) { + if (*val == NUL) { + return FAIL; + } // check for basic match if (check_opt_strings(val, p_scl_values, false) == OK) { return OK; |