comparison src/terminal.c @ 18402:527b7084c556 v8.1.2195

patch 8.1.2195: Vim does not exit when the terminal window is last window Commit: https://github.com/vim/vim/commit/4d14bac8e7441368977e81266166f728105a60d4 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 20 21:15:15 2019 +0200 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)
author Bram Moolenaar <Bram@vim.org>
date Sun, 20 Oct 2019 21:30:03 +0200
parents 506bf60a30a0
children 3a3efaaa05c5
comparison
equal deleted inserted replaced
18401:d1bb50cdb9ad 18402:527b7084c556
3071 if (term->tl_finish == TL_FINISH_CLOSE) 3071 if (term->tl_finish == TL_FINISH_CLOSE)
3072 { 3072 {
3073 aco_save_T aco; 3073 aco_save_T aco;
3074 int do_set_w_closing = term->tl_buffer->b_nwindows == 0; 3074 int do_set_w_closing = term->tl_buffer->b_nwindows == 0;
3075 3075
3076 // If this is the last normal window: exit Vim.
3077 if (term->tl_buffer->b_nwindows > 0 && only_one_window())
3078 {
3079 exarg_T ea;
3080
3081 vim_memset(&ea, 0, sizeof(ea));
3082 ex_quit(&ea);
3083 return TRUE;
3084 }
3085
3076 // ++close or term_finish == "close" 3086 // ++close or term_finish == "close"
3077 ch_log(NULL, "terminal job finished, closing window"); 3087 ch_log(NULL, "terminal job finished, closing window");
3078 aucmd_prepbuf(&aco, term->tl_buffer); 3088 aucmd_prepbuf(&aco, term->tl_buffer);
3079 // Avoid closing the window if we temporarily use it. 3089 // Avoid closing the window if we temporarily use it.
3080 if (curwin == aucmd_win) 3090 if (curwin == aucmd_win)