aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.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/fileio.c
parentfe99930c46c096b9be277d3201b3ea9b5bf2f659 (diff)
downloadrneovim-ac0b9714edbb7697b8324f922024401baea8953b.tar.gz
rneovim-ac0b9714edbb7697b8324f922024401baea8953b.tar.bz2
rneovim-ac0b9714edbb7697b8324f922024401baea8953b.zip
Additional FOR_ALL_WINDOWS usage
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 0a05b2a4db..97daa035f8 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -6177,12 +6177,17 @@ aucmd_prepbuf (
int save_acd;
/* Find a window that is for the new buffer */
- if (buf == curbuf) /* be quick when buf is curbuf */
+ if (buf == curbuf) { /* be quick when buf is curbuf */
win = curwin;
- else
- for (win = firstwin; win != NULL; win = win->w_next)
- if (win->w_buffer == buf)
+ } else {
+ win = NULL;
+ FOR_ALL_WINDOWS(wp) {
+ if (wp->w_buffer == buf) {
+ win = wp;
break;
+ }
+ }
+ }
/* Allocate "aucmd_win" when needed. If this fails (out of memory) fall
* back to using the current window. */