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/option.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/option.c')
-rw-r--r-- | src/nvim/option.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 6eac1033c4..b9becebbf4 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -4306,7 +4306,6 @@ did_set_string_option ( /* When 'spelllang' or 'spellfile' is set and there is a window for this * buffer in which 'spell' is set load the wordlists. */ else if (varp == &(curbuf->b_s.b_p_spl) || varp == &(curbuf->b_s.b_p_spf)) { - win_T *wp; int l; if (varp == &(curbuf->b_s.b_p_spf)) { @@ -4317,10 +4316,11 @@ did_set_string_option ( } if (errmsg == NULL) { - FOR_ALL_WINDOWS(wp) - if (wp->w_buffer == curbuf && wp->w_p_spell) { - errmsg = did_set_spelllang(wp); - break; + FOR_ALL_WINDOWS(wp) { + if (wp->w_buffer == curbuf && wp->w_p_spell) { + errmsg = did_set_spelllang(wp); + break; + } } } } @@ -5075,9 +5075,7 @@ set_bool_option ( /* There can be only one window with 'previewwindow' set. */ else if ((int *)varp == &curwin->w_p_pvw) { if (curwin->w_p_pvw) { - 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; return (char_u *)N_("E590: A preview window already exists"); |