mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 06:58:35 +00:00
Merge pull request #4296 from mhinz/fix-termclose
Make TermClose event return the associated buffer
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user