diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-07-24 22:04:11 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-07-24 22:04:11 +0200 |
commit | 2932359000b2f918d5fade79ea4d124d5943cd07 (patch) | |
tree | 1ca4fa98569a4d20ce066c7d6254404bcf431b47 /src/option.c | |
parent | 6835dc61aebca2b602d85a9d63c449ace58683b4 (diff) |
patch 7.4.2101v7.4.2101
Problem: Looping over windows, buffers and tab pages is inconsistant.
Solution: Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan)
Diffstat (limited to 'src/option.c')
-rw-r--r-- | src/option.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/option.c b/src/option.c index 288c01bbaa..b9b59eefd0 100644 --- a/src/option.c +++ b/src/option.c @@ -6342,7 +6342,7 @@ did_set_string_option( { buf_T *buf; - for (buf = firstbuf; buf != NULL; buf = buf->b_next) + FOR_ALL_BUFFERS(buf) if (buf != curbuf && *buf->b_p_cm == NUL) ml_set_crypt_key(buf, buf->b_p_key, oldval); } @@ -7864,7 +7864,7 @@ set_bool_option( char_u hash[UNDO_HASH_SIZE]; buf_T *save_curbuf = curbuf; - for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next) + FOR_ALL_BUFFERS(curbuf) { /* When 'undofile' is set globally: for every buffer, otherwise * only for the current buffer: Try to read in the undofile, @@ -8040,7 +8040,7 @@ set_bool_option( { win_T *win; - for (win = firstwin; win != NULL; win = win->w_next) + FOR_ALL_WINDOWS(win) if (win->w_p_pvw && win != curwin) { curwin->w_p_pvw = FALSE; @@ -11651,7 +11651,7 @@ paste_option_changed(void) if (!old_p_paste) { /* save options for each buffer */ - for (buf = firstbuf; buf != NULL; buf = buf->b_next) + FOR_ALL_BUFFERS(buf) { buf->b_p_tw_nopaste = buf->b_p_tw; buf->b_p_wm_nopaste = buf->b_p_wm; @@ -11683,7 +11683,7 @@ paste_option_changed(void) * already on. */ /* set options for each buffer */ - for (buf = firstbuf; buf != NULL; buf = buf->b_next) + FOR_ALL_BUFFERS(buf) { buf->b_p_tw = 0; /* textwidth is 0 */ buf->b_p_wm = 0; /* wrapmargin is 0 */ @@ -11719,7 +11719,7 @@ paste_option_changed(void) else if (old_p_paste) { /* restore options for each buffer */ - for (buf = firstbuf; buf != NULL; buf = buf->b_next) + FOR_ALL_BUFFERS(buf) { buf->b_p_tw = buf->b_p_tw_nopaste; buf->b_p_wm = buf->b_p_wm_nopaste; |