mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.1.2195: Vim does not exit when the terminal window is last window
Problem: Vim does not exit when closing a terminal window and it is the last window. Solution: Exit Vim if the closed terminal window is the last one. (closes #4539)
This commit is contained in:
@@ -3073,6 +3073,16 @@ term_after_channel_closed(term_T *term)
|
||||
aco_save_T aco;
|
||||
int do_set_w_closing = term->tl_buffer->b_nwindows == 0;
|
||||
|
||||
// If this is the last normal window: exit Vim.
|
||||
if (term->tl_buffer->b_nwindows > 0 && only_one_window())
|
||||
{
|
||||
exarg_T ea;
|
||||
|
||||
vim_memset(&ea, 0, sizeof(ea));
|
||||
ex_quit(&ea);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ++close or term_finish == "close"
|
||||
ch_log(NULL, "terminal job finished, closing window");
|
||||
aucmd_prepbuf(&aco, term->tl_buffer);
|
||||
|
Reference in New Issue
Block a user