diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-09-08 20:50:44 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-09-08 20:50:44 -0400 |
commit | 9fa467a9b227243c9c534ae0df1bdaf8235551a0 (patch) | |
tree | 85449173705a443081b1189a9d1087df74030703 /src/nvim/misc1.c | |
parent | 3f5482d3251b3bbdc7c4df8a8e64eb3af7e5922c (diff) | |
parent | ac0b9714edbb7697b8324f922024401baea8953b (diff) | |
download | rneovim-9fa467a9b227243c9c534ae0df1bdaf8235551a0.tar.gz rneovim-9fa467a9b227243c9c534ae0df1bdaf8235551a0.tar.bz2 rneovim-9fa467a9b227243c9c534ae0df1bdaf8235551a0.zip |
Merge pull request #1096 from war1025/dev/local_for_all_windows
Convert FOR_ALL_WINDOWS to use a locally declared pointer
Diffstat (limited to 'src/nvim/misc1.c')
-rw-r--r-- | src/nvim/misc1.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index 8669977ea1..f670098896 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -1877,16 +1877,16 @@ void changed_bytes(linenr_T lnum, colnr_T col) /* Diff highlighting in other diff windows may need to be updated too. */ if (curwin->w_p_diff) { - win_T *wp; linenr_T wlnum; - for (wp = firstwin; wp != NULL; wp = wp->w_next) + FOR_ALL_WINDOWS(wp) { if (wp->w_p_diff && wp != curwin) { redraw_win_later(wp, VALID); wlnum = diff_lnum_win(lnum, wp); if (wlnum > 0) changedOneline(wp->w_buffer, wlnum); } + } } } @@ -1973,17 +1973,18 @@ changed_lines ( /* When the number of lines doesn't change then mark_adjust() isn't * called and other diff buffers still need to be marked for * displaying. */ - win_T *wp; linenr_T wlnum; - for (wp = firstwin; wp != NULL; wp = wp->w_next) + FOR_ALL_WINDOWS(wp) { if (wp->w_p_diff && wp != curwin) { redraw_win_later(wp, VALID); wlnum = diff_lnum_win(lnum, wp); - if (wlnum > 0) + if (wlnum > 0) { changed_lines_buf(wp->w_buffer, wlnum, lnume - lnum + wlnum, 0L); + } } + } } changed_common(lnum, col, lnume, xtra); @@ -2214,14 +2215,14 @@ unchanged ( */ void check_status(buf_T *buf) { - win_T *wp; - - for (wp = firstwin; wp != NULL; wp = wp->w_next) + FOR_ALL_WINDOWS(wp) { if (wp->w_buffer == buf && wp->w_status_height) { wp->w_redr_status = TRUE; - if (must_redraw < VALID) + if (must_redraw < VALID) { must_redraw = VALID; + } } + } } /* |