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

@@ -730,7 +730,7 @@ update_screen(int type)
#ifdef FEAT_WINDOWS
/* Reset b_mod_set flags. Going through all windows is probably faster
* than going through all buffers (there could be many buffers). */
for (wp = firstwin; wp != NULL; wp = wp->w_next)
FOR_ALL_WINDOWS(wp)
wp->w_buffer->b_mod_set = FALSE;
#else
curbuf->b_mod_set = FALSE;
@@ -962,7 +962,7 @@ update_debug_sign(buf_T *buf, linenr_T lnum)
update_prepare();
# ifdef FEAT_WINDOWS
for (wp = firstwin; wp; wp = wp->w_next)
FOR_ALL_WINDOWS(wp)
{
if (wp->w_redr_type != 0)
win_update(wp);
@@ -6271,7 +6271,7 @@ status_redraw_all(void)
{
win_T *wp;
for (wp = firstwin; wp; wp = wp->w_next)
FOR_ALL_WINDOWS(wp)
if (wp->w_status_height)
{
wp->w_redr_status = TRUE;
@@ -6287,7 +6287,7 @@ status_redraw_curbuf(void)
{
win_T *wp;
for (wp = firstwin; wp; wp = wp->w_next)
FOR_ALL_WINDOWS(wp)
if (wp->w_status_height != 0 && wp->w_buffer == curbuf)
{
wp->w_redr_status = TRUE;
@@ -6303,7 +6303,7 @@ redraw_statuslines(void)
{
win_T *wp;
for (wp = firstwin; wp; wp = wp->w_next)
FOR_ALL_WINDOWS(wp)
if (wp->w_redr_status)
win_redr_status(wp);
if (redraw_tabline)
@@ -10360,7 +10360,7 @@ draw_tabline(void)
else
#endif
{
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
FOR_ALL_TABPAGES(tp)
++tabcount;
tabwidth = (Columns - 1 + tabcount / 2) / tabcount;