1
0
forked from aniani/vim

patch 8.2.0500: using the same loop in many places

Problem:    Using the same loop in many places.
Solution:   Define more FOR_ALL macros. (Yegappan Lakshmanan, closes #5339)
This commit is contained in:
Bram Moolenaar
2020-04-02 18:50:46 +02:00
parent f10806b250
commit aeea72151c
34 changed files with 176 additions and 141 deletions

View File

@@ -676,6 +676,11 @@ EXTERN win_T *prevwin INIT(= NULL); // previous window
for ((wp) = ((tp) == curtab) \
? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
#define FOR_ALL_POPUPWINS(wp) \
for ((wp) = first_popupwin; (wp) != NULL; (wp) = (wp)->w_next)
#define FOR_ALL_POPUPWINS_IN_TAB(tp, wp) \
for ((wp) = (tp)->tp_first_popupwin; (wp) != NULL; (wp) = (wp)->w_next)
EXTERN win_T *curwin; // currently active window
@@ -716,6 +721,9 @@ EXTERN buf_T *curbuf INIT(= NULL); // currently active buffer
#define FOR_ALL_BUFFERS(buf) for (buf = firstbuf; buf != NULL; buf = buf->b_next)
#define FOR_ALL_BUF_WININFO(buf, wip) \
for ((wip) = (buf)->b_wininfo; (wip) != NULL; (wip) = (wip)->wi_next)
// Iterate through all the signs placed in a buffer
#define FOR_ALL_SIGNS_IN_BUF(buf, sign) \
for (sign = buf->b_signlist; sign != NULL; sign = sign->se_next)
@@ -1469,6 +1477,9 @@ EXTERN disptick_T display_tick INIT(= 0);
// Line in which spell checking wasn't highlighted because it touched the
// cursor position in Insert mode.
EXTERN linenr_T spell_redraw_lnum INIT(= 0);
#define FOR_ALL_SPELL_LANGS(slang) \
for ((slang) = first_lang; (slang) != NULL; (slang) = slang->sl_next)
#endif
#ifdef FEAT_CONCEAL
@@ -1822,3 +1833,6 @@ EXTERN int did_repeated_msg INIT(= 0);
# define REPEATED_MSG_LOOKING 1
# define REPEATED_MSG_SAFESTATE 2
#endif
#define FOR_ALL_LIST_ITEMS(l, li) \
for ((li) = (l)->lv_first; (li) != NULL; (li) = (li)->li_next)