aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_docmd.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-03-15 13:47:13 +0100
committerGitHub <noreply@github.com>2017-03-15 13:47:13 +0100
commit3b52e3c4c8784d60e44f3dc9a6bb7795af588931 (patch)
tree5df3024e99dd2a92042b054cfd39fa083d1a1fba /src/nvim/ex_docmd.c
parent227859ea79f981e67d5835cfed0be2123522ab2e (diff)
parentd72c177b2a743e147e0386f97b07030b49247390 (diff)
downloadrneovim-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_docmd.c')
-rw-r--r--src/nvim/ex_docmd.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 774380b2f0..c7cb875b88 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -50,6 +50,7 @@
#include "nvim/screen.h"
#include "nvim/search.h"
#include "nvim/spell.h"
+#include "nvim/spellfile.h"
#include "nvim/strings.h"
#include "nvim/syntax.h"
#include "nvim/tag.h"
@@ -5850,18 +5851,20 @@ static void ex_quit_all(exarg_T *eap)
*/
static void ex_close(exarg_T *eap)
{
- win_T *win;
+ win_T *win = NULL;
int winnr = 0;
- if (cmdwin_type != 0)
+ if (cmdwin_type != 0) {
cmdwin_result = Ctrl_C;
- else if (!text_locked() && !curbuf_locked()) {
- if (eap->addr_count == 0)
+ } else if (!text_locked() && !curbuf_locked()) {
+ if (eap->addr_count == 0) {
ex_win_close(eap->forceit, curwin, NULL);
- else {
- for (win = firstwin; win != NULL; win = win->w_next) {
+ } else {
+ FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
winnr++;
- if (winnr == eap->line2)
+ if (winnr == eap->line2) {
+ win = wp;
break;
+ }
}
if (win == NULL)
win = lastwin;
@@ -6073,12 +6076,14 @@ static void ex_hide(exarg_T *eap)
win_close(curwin, FALSE); /* don't free buffer */
else {
int winnr = 0;
- win_T *win;
+ win_T *win = NULL;
- for (win = firstwin; win != NULL; win = win->w_next) {
+ FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
winnr++;
- if (winnr == eap->line2)
+ if (winnr == eap->line2) {
+ win = wp;
break;
+ }
}
if (win == NULL)
win = lastwin;
@@ -6845,7 +6850,8 @@ static void ex_syncbind(exarg_T *eap)
/*
* Set all scrollbind windows to the same topline.
*/
- for (curwin = firstwin; curwin; curwin = curwin->w_next) {
+ FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
+ curwin = wp;
if (curwin->w_p_scb) {
curbuf = curwin->w_buffer;
y = topline - curwin->w_topline;