Mercurial > vim
diff src/ex_docmd.c @ 11957:bc0fee081e1e
patch 8.0.0858: can exit while a terminal is still running a job
commit https://github.com/vim/vim/commit/eb44a68b42eda207a5bc4def9ea8fc4d38acb650
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 3 22:44:55 2017 +0200
patch 8.0.0858: can exit while a terminal is still running a job
Problem: Can exit while a terminal is still running a job.
Solution: Consider a buffer with a running job like a changed file.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 03 Aug 2017 22:45:04 +0200 |
parents | 1c1cb1e9b7b3 |
children | 7df3dd3c0ac1 |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -7291,7 +7291,7 @@ ex_quit(exarg_T *eap) */ if (check_more(FALSE, eap->forceit) == OK && only_one_window()) exiting = TRUE; - if ((!P_HID(curbuf) + if ((!buf_hide(curbuf) && check_changed(curbuf, (p_awa ? CCGD_AW : 0) | (eap->forceit ? CCGD_FORCEIT : 0) | CCGD_EXCMD)) @@ -7318,7 +7318,7 @@ ex_quit(exarg_T *eap) need_mouse_correct = TRUE; # endif /* close window; may free buffer */ - win_close(wp, !P_HID(wp->w_buffer) || eap->forceit); + win_close(wp, !buf_hide(wp->w_buffer) || eap->forceit); #endif } } @@ -7438,7 +7438,7 @@ ex_win_close( buf_T *buf = win->w_buffer; need_hide = (bufIsChanged(buf) && buf->b_nwindows <= 1); - if (need_hide && !P_HID(buf) && !forceit) + if (need_hide && !buf_hide(buf) && !forceit) { # if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) if ((p_confirm || cmdmod.confirm) && p_write) @@ -7465,9 +7465,9 @@ ex_win_close( /* free buffer when not hiding it or when it's a scratch buffer */ if (tp == NULL) - win_close(win, !need_hide && !P_HID(buf)); + win_close(win, !need_hide && !buf_hide(buf)); else - win_close_othertab(win, !need_hide && !P_HID(buf), tp); + win_close_othertab(win, !need_hide && !buf_hide(buf), tp); } /* @@ -7864,7 +7864,7 @@ ex_exit(exarg_T *eap) need_mouse_correct = TRUE; # endif /* Quit current window, may free the buffer. */ - win_close(curwin, !P_HID(curwin->w_buffer)); + win_close(curwin, !buf_hide(curwin->w_buffer)); #endif } } @@ -7960,7 +7960,7 @@ handle_drop( * We don't need to check if the 'hidden' option is set, as in this * case the buffer won't be lost. */ - if (!P_HID(curbuf) && !split) + if (!buf_hide(curbuf) && !split) { ++emsg_off; split = check_changed(curbuf, CCGD_AW); @@ -8747,7 +8747,7 @@ do_exedit( (*eap->arg == NUL && eap->do_ecmd_lnum == 0 && vim_strchr(p_cpo, CPO_GOTO1) != NULL) ? ECMD_ONE : eap->do_ecmd_lnum, - (P_HID(curbuf) ? ECMD_HIDE : 0) + (buf_hide(curbuf) ? ECMD_HIDE : 0) + (eap->forceit ? ECMD_FORCEIT : 0) /* after a split we can use an existing buffer */ + (old_curwin != NULL ? ECMD_OLDBUF : 0) @@ -8761,7 +8761,7 @@ do_exedit( if (old_curwin != NULL) { need_hide = (curbufIsChanged() && curbuf->b_nwindows <= 1); - if (!need_hide || P_HID(curbuf)) + if (!need_hide || buf_hide(curbuf)) { # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) cleanup_T cs; @@ -8773,7 +8773,7 @@ do_exedit( # ifdef FEAT_GUI need_mouse_correct = TRUE; # endif - win_close(curwin, !need_hide && !P_HID(curbuf)); + win_close(curwin, !need_hide && !buf_hide(curbuf)); # if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) /* Restore the error/interrupt/exception state if not