aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/quickfix.c
diff options
context:
space:
mode:
authorWayne Rowcliffe <war1025@gmail.com>2014-08-20 19:39:05 -0500
committerWayne Rowcliffe <war1025@gmail.com>2014-09-08 17:27:41 -0500
commitac0b9714edbb7697b8324f922024401baea8953b (patch)
tree85449173705a443081b1189a9d1087df74030703 /src/nvim/quickfix.c
parentfe99930c46c096b9be277d3201b3ea9b5bf2f659 (diff)
downloadrneovim-ac0b9714edbb7697b8324f922024401baea8953b.tar.gz
rneovim-ac0b9714edbb7697b8324f922024401baea8953b.tar.bz2
rneovim-ac0b9714edbb7697b8324f922024401baea8953b.zip
Additional FOR_ALL_WINDOWS usage
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r--src/nvim/quickfix.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index bbd837fda9..ce2a80adaa 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -1379,14 +1379,16 @@ void qf_jump(qf_info_T *qi, int dir, int errornr, int forceit)
* For ":helpgrep" find a help window or open one.
*/
if (qf_ptr->qf_type == 1 && (!curwin->w_buffer->b_help || cmdmod.tab != 0)) {
- win_T *wp;
+ win_T *wp = NULL;
- if (cmdmod.tab != 0)
- wp = NULL;
- else
- for (wp = firstwin; wp != NULL; wp = wp->w_next)
- if (wp->w_buffer != NULL && wp->w_buffer->b_help)
+ if (cmdmod.tab == 0) {
+ FOR_ALL_WINDOWS(wp2) {
+ if (wp2->w_buffer != NULL && wp2->w_buffer->b_help) {
+ wp = wp2;
break;
+ }
+ }
+ }
if (wp != NULL && wp->w_buffer->b_nwindows > 0)
win_enter(wp, true);
else {