1
0
forked from aniani/vim

patch 7.4.2101

Problem:    Looping over windows, buffers and tab pages is inconsistant.
Solution:   Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan)
This commit is contained in:
Bram Moolenaar
2016-07-24 22:04:11 +02:00
parent 6835dc61ae
commit 2932359000
33 changed files with 148 additions and 142 deletions

View File

@@ -742,7 +742,7 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
win_T *wp;
/* set options in each window for "vimdiff". */
for (wp = firstwin; wp != NULL; wp = wp->w_next)
FOR_ALL_WINDOWS(wp)
diff_win_options(wp, TRUE);
}
#endif
@@ -1375,8 +1375,7 @@ getout(int exitval)
for (tp = first_tabpage; tp != NULL; tp = next_tp)
{
next_tp = tp->tp_next;
for (wp = (tp == curtab)
? firstwin : tp->tp_firstwin; wp != NULL; wp = wp->w_next)
FOR_ALL_WINDOWS_IN_TAB(tp, wp)
{
if (wp->w_buffer == NULL)
/* Autocmd must have close the buffer already, skip. */
@@ -1399,7 +1398,7 @@ getout(int exitval)
# endif
/* Trigger BufUnload for buffers that are loaded */
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
FOR_ALL_BUFFERS(buf)
if (buf->b_ml.ml_mfp != NULL)
{
bufref_T bufref;