vim-patch:8.2.1478: Vim9: cannot use "true" for some popup options (#41236)

Problem:    Vim9: cannot use "true" for some popup options.
Solution:   Add dict_get_bool(). (closes vim/vim#6725)

558813314d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2026-08-08 01:19:59 -04:00
committed by GitHub
parent 27e36dea19
commit a08607b8d6

View File

@@ -2327,6 +2327,13 @@ varnumber_T tv_dict_get_number_def(const dict_T *const d, const char *const key,
return tv_get_number(&di->di_tv);
}
/// Gets a bool item from a dictionary, or a given default value.
///
/// @param[in] d Dictionary to get item from.
/// @param[in] key Key to find in dictionary.
/// @param[in] def Default value.
///
/// @return Number value, or `def` value if the item does not exist.
varnumber_T tv_dict_get_bool(const dict_T *const d, const char *const key, const int def)
FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
{