diff options
author | ZyX <kp-pav@yandex.ru> | 2017-12-24 02:41:34 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-12-24 14:09:36 +0300 |
commit | ac55558c97d02f18b9a99cf2dd279451481c4a2f (patch) | |
tree | 699426348587c2604d8eae377c0b0a5af8e44c4d /src/nvim/eval/typval.c | |
parent | 608c3d7baf2745b188bc42f9f45ad1bb188a4828 (diff) | |
download | rneovim-ac55558c97d02f18b9a99cf2dd279451481c4a2f.tar.gz rneovim-ac55558c97d02f18b9a99cf2dd279451481c4a2f.tar.bz2 rneovim-ac55558c97d02f18b9a99cf2dd279451481c4a2f.zip |
eval/typval: Make tv_list_item_remove return pointer to the next item
Diffstat (limited to 'src/nvim/eval/typval.c')
-rw-r--r-- | src/nvim/eval/typval.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index a49c34e957..4ebe12104f 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -64,12 +64,17 @@ static listitem_T *tv_list_item_alloc(void) /// /// @param[out] l List to remove item from. /// @param[in,out] item Item to remove. -void tv_list_item_remove(list_T *const l, listitem_T *const item) +/// +/// @return Pointer to the list item just after removed one, NULL if removed +/// item was the last one. +listitem_T *tv_list_item_remove(list_T *const l, listitem_T *const item) FUNC_ATTR_NONNULL_ALL { + listitem_T *const next_item = TV_LIST_ITEM_NEXT(l, item); tv_list_remove_items(l, item, item); tv_clear(TV_LIST_ITEM_TV(item)); xfree(item); + return next_item; } //{{{2 List watchers |