mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
eval: Use tv_is_func in place of ==VAR_FUNC||==VAR_PARTIAL
Also fixes same error as in vim/vim#1557
This commit is contained in:
@@ -408,6 +408,21 @@ static inline DictWatcher *tv_dict_watcher_node_data(QUEUE *q)
|
||||
return QUEUE_DATA(q, DictWatcher, node);
|
||||
}
|
||||
|
||||
static inline bool tv_is_func(const typval_T tv)
|
||||
FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_CONST;
|
||||
|
||||
/// Check whether given typval_T contains a function
|
||||
///
|
||||
/// That is, whether it contains VAR_FUNC or VAR_PARTIAL.
|
||||
///
|
||||
/// @param[in] tv Typval to check.
|
||||
///
|
||||
/// @return True if it is a function or a partial, false otherwise.
|
||||
static inline bool tv_is_func(const typval_T tv)
|
||||
{
|
||||
return tv.v_type == VAR_FUNC || tv.v_type == VAR_PARTIAL;
|
||||
}
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "eval/typval.h.generated.h"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user