aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/terminal.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-02-21 02:04:13 -0500
committerJustin M. Keyes <justinkz@gmail.com>2016-02-21 02:04:13 -0500
commitfc51f86b727bb3bd8e65b8a0bab0548a90582269 (patch)
tree2369c276b51a8b3772383c752a4240366dbed6fa /src/nvim/terminal.c
parent51055c14a623ca824d69b257304f0dd813cfda1f (diff)
parent6732f0193af55edd48bce6a988254ccdcd7ab8b4 (diff)
downloadrneovim-fc51f86b727bb3bd8e65b8a0bab0548a90582269.tar.gz
rneovim-fc51f86b727bb3bd8e65b8a0bab0548a90582269.tar.bz2
rneovim-fc51f86b727bb3bd8e65b8a0bab0548a90582269.zip
Merge pull request #4296 from mhinz/fix-termclose
Make TermClose event return the associated buffer
Diffstat (limited to 'src/nvim/terminal.c')
-rw-r--r--src/nvim/terminal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c
index dc5f348078..fb74569e3b 100644
--- a/src/nvim/terminal.c
+++ b/src/nvim/terminal.c
@@ -288,8 +288,9 @@ void terminal_close(Terminal *term, char *msg)
term->forward_mouse = false;
term->closed = true;
+ buf_T *buf = handle_get_buffer(term->buf_handle);
+
if (!msg || exiting) {
- buf_T *buf = handle_get_buffer(term->buf_handle);
// If no msg was given, this was called by close_buffer(buffer.c). Or if
// exiting, we must inform the buffer the terminal no longer exists so that
// close_buffer() doesn't call this again.
@@ -304,6 +305,10 @@ void terminal_close(Terminal *term, char *msg)
} else {
terminal_receive(term, msg, strlen(msg));
}
+
+ if (buf) {
+ apply_autocmds(EVENT_TERMCLOSE, NULL, NULL, false, buf);
+ }
}
void terminal_resize(Terminal *term, uint16_t width, uint16_t height)