diff options
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 5ece5e4e5d..069304d9e1 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -33,6 +33,7 @@ #include "nvim/api/extmark.h" #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" +#include "nvim/api/private/validate.h" #include "nvim/ascii.h" #include "nvim/autocmd.h" #include "nvim/buffer.h" @@ -2177,9 +2178,6 @@ static char *set_bool_option(const int opt_idx, char *const varp, const int valu if (curwin->w_p_spell) { errmsg = did_set_spelllang(curwin); } - } else if (((int *)varp == &curwin->w_p_nu || (int *)varp == &curwin->w_p_rnu) - && *curwin->w_p_stc != NUL) { // '(relative)number' + 'statuscolumn' - curwin->w_nrwidth_line_count = 0; } if ((int *)varp == &curwin->w_p_arab) { @@ -5624,10 +5622,9 @@ long get_sidescrolloff_value(win_T *wp) Dictionary get_vimoption(String name, Error *err) { int opt_idx = findoption_len((const char *)name.data, name.size); - if (opt_idx < 0) { - api_set_error(err, kErrorTypeValidation, "no such option: '%s'", name.data); + VALIDATE_S(opt_idx >= 0, "option (not found)", name.data, { return (Dictionary)ARRAY_DICT_INIT; - } + }); return vimoption2dict(&options[opt_idx]); } |