clint,eval: Make linter check for direct usage of list attributes

This commit is contained in:
ZyX
2017-12-12 01:13:04 +03:00
parent 45998deb5d
commit 932ea7a0d1
3 changed files with 46 additions and 11 deletions

View File

@@ -440,6 +440,21 @@ static inline int tv_list_uidx(const list_T *const l, int n)
return n;
}
static inline bool tv_list_has_watchers(const list_T *const l)
REAL_FATTR_PURE REAL_FATTR_WARN_UNUSED_RESULT;
/// Check whether list has watchers
///
/// E.g. is referenced by a :for loop.
///
/// @param[in] l List to check.
///
/// @return true if there are watchers, false otherwise.
static inline bool tv_list_has_watchers(const list_T *const l)
{
return l && l->lv_watch;
}
static inline listitem_T *tv_list_first(const list_T *const l)
REAL_FATTR_PURE REAL_FATTR_WARN_UNUSED_RESULT;