Mercurial > vim
diff src/option.c @ 29497:9908c07ccb56 v9.0.0090
patch 9.0.0090: no error when assigning bool to a string option
Commit: https://github.com/vim/vim/commit/28f84e17b068daca2635692d279930dcb7a150d0
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 27 12:30:13 2022 +0100
patch 9.0.0090: no error when assigning bool to a string option
Problem: No error when assigning bool to a string option with setwinvar().
Solution: Give an error (closes https://github.com/vim/vim/issues/10766)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 27 Jul 2022 13:45:05 +0200 |
parents | caaf5b270018 |
children | d61007cc39b3 |
line wrap: on
line diff
--- a/src/option.c +++ b/src/option.c @@ -4478,6 +4478,20 @@ is_option_allocated(char *name) } #endif +#if defined(FEAT_EVAL) || defined(PROTO) +/* + * Return TRUE if "name" is a string option. + * Returns FALSE if option "name" does not exist. + */ + int +is_string_option(char_u *name) +{ + int idx = findoption(name); + + return idx >= 0 && (options[idx].flags & P_STRING); +} +#endif + /* * Translate a string like "t_xx", "<t_xx>" or "<S-Tab>" to a key number. * When "has_lt" is true there is a '<' before "*arg_arg".