diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-20 21:15:15 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-20 21:15:15 +0200 |
commit | 4d14bac8e7441368977e81266166f728105a60d4 (patch) | |
tree | 3f01c776a80d91bb2568621df4e494846ea10460 /src/terminal.c | |
parent | 4b57018ee4e6d608e3a28e0ee4fdd2f057cc0e89 (diff) | |
download | vim-git-4d14bac8e7441368977e81266166f728105a60d4.tar.gz |
patch 8.1.2195: Vim does not exit when the terminal window is last windowv8.1.2195
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)
Diffstat (limited to 'src/terminal.c')
-rw-r--r-- | src/terminal.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/terminal.c b/src/terminal.c index 7b2d43bf2..07b2e973e 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -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); |