diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-02-16 22:11:02 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-02-16 22:11:02 +0000 |
commit | f740b29ae2a346e44c34001b3bf8ecfa0c7857bd (patch) | |
tree | 5b62807af1359d3df97367448927cdbb53969448 /src/main.c | |
parent | 4c7ed462cb7813730b4f15f9cb09f1b26d097fca (diff) | |
download | vim-git-f740b29ae2a346e44c34001b3bf8ecfa0c7857bd.tar.gz |
updated for version 7.0199v7.0199
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/main.c b/src/main.c index 81e41b692..1a71be908 100644 --- a/src/main.c +++ b/src/main.c @@ -1133,6 +1133,7 @@ getout(exitval) #ifdef FEAT_AUTOCMD buf_T *buf; win_T *wp; + tabpage_T *tp, *next_tp; #endif exiting = TRUE; @@ -1160,23 +1161,28 @@ getout(exitval) #ifdef FEAT_AUTOCMD /* Trigger BufWinLeave for all windows, but only once per buffer. */ - for (wp = firstwin; wp != NULL; ) +# if defined FEAT_WINDOWS + for (tp = first_tabpage; tp != NULL; tp = next_tp) { - buf = wp->w_buffer; - if (buf->b_changedtick != -1) + next_tp = tp->tp_next; + for (wp = (tp->tp_topframe == topframe) + ? firstwin : tp->tp_firstwin; wp != NULL; wp = wp->w_next) { - apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname, + buf = wp->w_buffer; + if (buf->b_changedtick != -1) + { + apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname, FALSE, buf); - buf->b_changedtick = -1; /* note that we did it already */ - wp = firstwin; /* restart, window may be closed */ + buf->b_changedtick = -1; /* note that we did it already */ + /* start all over, autocommands may mess up the lists */ + next_tp = first_tabpage; + break; + } } -# ifdef FEAT_WINDOWS - else - wp = wp->w_next; + } # else - break; + apply_autocmds(EVENT_BUFWINLEAVE, curbuf, curbuf->b_fname, FALSE, curbuf); # endif - } /* Trigger BufUnload for buffers that are loaded */ for (buf = firstbuf; buf != NULL; buf = buf->b_next) |