diff options
author | Daniel Hahler <git@thequod.de> | 2017-12-29 16:56:14 +0100 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2017-12-29 16:56:14 +0100 |
commit | 2c436b33621a3064aae94e88db90095ae69aabc8 (patch) | |
tree | 8a4e7ed2de6d42d133a8f8488ed273b3eb389476 | |
parent | ddcfb492628389441b608b8977b0140523cddedb (diff) | |
download | rneovim-2c436b33621a3064aae94e88db90095ae69aabc8.tar.gz rneovim-2c436b33621a3064aae94e88db90095ae69aabc8.tar.bz2 rneovim-2c436b33621a3064aae94e88db90095ae69aabc8.zip |
Fix TabClose autocommand via close_windows
Fixes https://github.com/neovim/neovim/issues/7781
-rw-r--r-- | src/nvim/window.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index 5e85a9bede..bbdf40b874 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -1741,6 +1741,11 @@ void close_windows(buf_T *buf, int keep_curwin) } else wp = wp->w_next; } + if (count != tabpage_index(NULL)) { + char_u prev_idx[NUMBUFLEN]; + sprintf((char *)prev_idx, "%i", tabpage_index(curtab)); + apply_autocmds(EVENT_TABCLOSED, prev_idx, prev_idx, false, curbuf); + } /* Also check windows in other tab pages. */ for (tp = first_tabpage; tp != NULL; tp = nexttp) { @@ -1757,15 +1762,16 @@ void close_windows(buf_T *buf, int keep_curwin) break; } } + if (count != tabpage_index(NULL)) { + char_u prev_idx[NUMBUFLEN]; + sprintf((char *)prev_idx, "%i", tabpage_index(tp)); + apply_autocmds(EVENT_TABCLOSED, prev_idx, prev_idx, false, curbuf); + } } } --RedrawingDisabled; - if (count != tabpage_index(NULL)) { - apply_autocmds(EVENT_TABCLOSED, NULL, NULL, false, curbuf); - } - redraw_tabline = true; if (h != tabline_height()) { shell_new_rows(); |