diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-09-22 13:38:58 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-09-22 13:38:58 -0400 |
commit | 1c84a0e09093d728408024a6baa9967df596be54 (patch) | |
tree | 3038828072136affc9de36257ac49ba069ede25b /src/nvim/main.c | |
parent | a4b9e0df67ae95777f8f7d833e7d4c6b8fc3840c (diff) | |
parent | 22bd722c011b04a5fff3182c370c877d82e0fbe0 (diff) | |
download | rneovim-1c84a0e09093d728408024a6baa9967df596be54.tar.gz rneovim-1c84a0e09093d728408024a6baa9967df596be54.tar.bz2 rneovim-1c84a0e09093d728408024a6baa9967df596be54.zip |
Merge pull request #1108 from war1025/dev/for_all_tabs
FOR_ALL_TAB_WINDOWS cleanup. Add FOR_ALL_TABS and FOR_ALL_WINDOWS_IN_TAB.
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r-- | src/nvim/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index 7dc299e73b..e3f1d88dff 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -758,7 +758,6 @@ main_loop ( /* Exit properly */ void getout(int exitval) { - win_T *wp; tabpage_T *tp, *next_tp; exiting = TRUE; @@ -780,11 +779,12 @@ void getout(int exitval) /* Trigger BufWinLeave for all windows, but only once per buffer. */ for (tp = first_tabpage; tp != NULL; tp = next_tp) { next_tp = tp->tp_next; - for (wp = (tp == curtab) - ? firstwin : tp->tp_firstwin; wp != NULL; wp = wp->w_next) { - if (wp->w_buffer == NULL) + FOR_ALL_WINDOWS_IN_TAB(wp, tp) { + if (wp->w_buffer == NULL) { /* Autocmd must have close the buffer already, skip. */ continue; + } + buf_T *buf = wp->w_buffer; if (buf->b_changedtick != -1) { apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, |