diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-03-07 17:13:51 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-03-07 17:13:51 +0000 |
commit | 14113fdf9cb3d588c0d1c3a210246b981cf5aad3 (patch) | |
tree | a0f17ad3f6c5b31a0463e452122ba9e5aaa9705a /src/textprop.c | |
parent | 663ee88a8260d69d9310e22f2bfdec49af6a102e (diff) |
patch 9.0.1390: FOR_ALL_ macros are defined in an unexpected filev9.0.1390
Problem: FOR_ALL_ macros are defined in an unexpected file.
Solution: Move FOR_ALL_ macros to macros.h. Add FOR_ALL_HASHTAB_ITEMS.
(Yegappan Lakshmanan, closes #12109)
Diffstat (limited to 'src/textprop.c')
-rw-r--r-- | src/textprop.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/textprop.c b/src/textprop.c index bee45b63f5..bead146336 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -723,7 +723,8 @@ count_props(linenr_T lnum, int only_starting, int last_line) static textprop_T *text_prop_compare_props; static buf_T *text_prop_compare_buf; -/* Score for sorting on position of the text property: 0: above, +/* + * Score for sorting on position of the text property: 0: above, * 1: after (default), 2: right, 3: below (comes last) */ static int @@ -933,7 +934,7 @@ find_type_by_id(hashtab_T *ht, proptype_T ***array, int id) if (*array == NULL) return NULL; todo = (long)ht->ht_used; - for (hi = ht->ht_array; todo > 0; ++hi) + FOR_ALL_HASHTAB_ITEMS(ht, hi, todo) { if (!HASHITEM_EMPTY(hi)) { @@ -1958,7 +1959,7 @@ f_prop_type_delete(typval_T *argvars, typval_T *rettv UNUSED) hash_remove(ht, hi, "prop type delete"); vim_free(prop); - // currently visibile text properties will disappear + // currently visible text properties will disappear redraw_all_later(UPD_CLEAR); changed_window_setting_buf(buf == NULL ? curbuf : buf); } @@ -2021,7 +2022,7 @@ list_types(hashtab_T *ht, list_T *l) hashitem_T *hi; todo = (long)ht->ht_used; - for (hi = ht->ht_array; todo > 0; ++hi) + FOR_ALL_HASHTAB_ITEMS(ht, hi, todo) { if (!HASHITEM_EMPTY(hi)) { @@ -2074,7 +2075,7 @@ clear_ht_prop_types(hashtab_T *ht) return; todo = (long)ht->ht_used; - for (hi = ht->ht_array; todo > 0; ++hi) + FOR_ALL_HASHTAB_ITEMS(ht, hi, todo) { if (!HASHITEM_EMPTY(hi)) { |