diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-03-15 13:47:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-15 13:47:13 +0100 |
commit | 3b52e3c4c8784d60e44f3dc9a6bb7795af588931 (patch) | |
tree | 5df3024e99dd2a92042b054cfd39fa083d1a1fba /src/nvim/ex_cmds.c | |
parent | 227859ea79f981e67d5835cfed0be2123522ab2e (diff) | |
parent | d72c177b2a743e147e0386f97b07030b49247390 (diff) | |
download | rneovim-3b52e3c4c8784d60e44f3dc9a6bb7795af588931.tar.gz rneovim-3b52e3c4c8784d60e44f3dc9a6bb7795af588931.tar.bz2 rneovim-3b52e3c4c8784d60e44f3dc9a6bb7795af588931.zip |
Merge #6252 from jamessan/vim-7.4.2069
vim-patch:7.4.2069,7.4.2101,7.4.2222,7.4.2223
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 159e027793..1b83677807 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -4363,19 +4363,22 @@ void ex_help(exarg_T *eap) if (!curwin->w_buffer->b_help || cmdmod.tab != 0 ) { - if (cmdmod.tab != 0) + 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) + } else { + wp = NULL; + FOR_ALL_WINDOWS_IN_TAB(wp2, curtab) { + if (wp2->w_buffer != NULL && wp2->w_buffer->b_help) { + wp = wp2; break; - if (wp != NULL && wp->w_buffer->b_nwindows > 0) + } + } + } + if (wp != NULL && wp->w_buffer->b_nwindows > 0) { win_enter(wp, true); - else { - /* - * There is no help window yet. - * Try to open the file specified by the "helpfile" option. - */ + } else { + // There is no help window yet. + // Try to open the file specified by the "helpfile" option. if ((helpfd = mch_fopen((char *)p_hf, READBIN)) == NULL) { smsg(_("Sorry, help file \"%s\" not found"), p_hf); goto erret; |