Mercurial > vim
comparison src/misc1.c @ 9649:fd9727ae3c49 v7.4.2101
commit https://github.com/vim/vim/commit/2932359000b2f918d5fade79ea4d124d5943cd07
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jul 24 22:04:11 2016 +0200
patch 7.4.2101
Problem: Looping over windows, buffers and tab pages is inconsistant.
Solution: Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 24 Jul 2016 22:15:07 +0200 |
parents | b2aada04d84e |
children | 7b39615c0db1 |
comparison
equal
deleted
inserted
replaced
9648:227649fd4301 | 9649:fd9727ae3c49 |
---|---|
2812 if (curwin->w_p_diff) | 2812 if (curwin->w_p_diff) |
2813 { | 2813 { |
2814 win_T *wp; | 2814 win_T *wp; |
2815 linenr_T wlnum; | 2815 linenr_T wlnum; |
2816 | 2816 |
2817 for (wp = firstwin; wp != NULL; wp = wp->w_next) | 2817 FOR_ALL_WINDOWS(wp) |
2818 if (wp->w_p_diff && wp != curwin) | 2818 if (wp->w_p_diff && wp != curwin) |
2819 { | 2819 { |
2820 redraw_win_later(wp, VALID); | 2820 redraw_win_later(wp, VALID); |
2821 wlnum = diff_lnum_win(lnum, wp); | 2821 wlnum = diff_lnum_win(lnum, wp); |
2822 if (wlnum > 0) | 2822 if (wlnum > 0) |
2922 * called and other diff buffers still need to be marked for | 2922 * called and other diff buffers still need to be marked for |
2923 * displaying. */ | 2923 * displaying. */ |
2924 win_T *wp; | 2924 win_T *wp; |
2925 linenr_T wlnum; | 2925 linenr_T wlnum; |
2926 | 2926 |
2927 for (wp = firstwin; wp != NULL; wp = wp->w_next) | 2927 FOR_ALL_WINDOWS(wp) |
2928 if (wp->w_p_diff && wp != curwin) | 2928 if (wp->w_p_diff && wp != curwin) |
2929 { | 2929 { |
2930 redraw_win_later(wp, VALID); | 2930 redraw_win_later(wp, VALID); |
2931 wlnum = diff_lnum_win(lnum, wp); | 2931 wlnum = diff_lnum_win(lnum, wp); |
2932 if (wlnum > 0) | 2932 if (wlnum > 0) |
3211 void | 3211 void |
3212 check_status(buf_T *buf) | 3212 check_status(buf_T *buf) |
3213 { | 3213 { |
3214 win_T *wp; | 3214 win_T *wp; |
3215 | 3215 |
3216 for (wp = firstwin; wp != NULL; wp = wp->w_next) | 3216 FOR_ALL_WINDOWS(wp) |
3217 if (wp->w_buffer == buf && wp->w_status_height) | 3217 if (wp->w_buffer == buf && wp->w_status_height) |
3218 { | 3218 { |
3219 wp->w_redr_status = TRUE; | 3219 wp->w_redr_status = TRUE; |
3220 if (must_redraw < VALID) | 3220 if (must_redraw < VALID) |
3221 must_redraw = VALID; | 3221 must_redraw = VALID; |
9473 screen_start(); /* don't know where cursor is now */ | 9473 screen_start(); /* don't know where cursor is now */ |
9474 out_flush(); | 9474 out_flush(); |
9475 | 9475 |
9476 ml_close_notmod(); /* close all not-modified buffers */ | 9476 ml_close_notmod(); /* close all not-modified buffers */ |
9477 | 9477 |
9478 for (buf = firstbuf; buf != NULL; buf = buf->b_next) | 9478 FOR_ALL_BUFFERS(buf) |
9479 { | 9479 { |
9480 if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL) | 9480 if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL) |
9481 { | 9481 { |
9482 OUT_STR("Vim: preserving files...\n"); | 9482 OUT_STR("Vim: preserving files...\n"); |
9483 screen_start(); /* don't know where cursor is now */ | 9483 screen_start(); /* don't know where cursor is now */ |