0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

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 #10766)
This commit is contained in:
Bram Moolenaar
2022-07-27 12:30:13 +01:00
parent 7db3a8e329
commit 28f84e17b0
5 changed files with 23 additions and 0 deletions

View File

@@ -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".