mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
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.
This commit is contained in:
@@ -2064,7 +2064,7 @@ dialog_changed(
|
||||
int
|
||||
can_abandon(buf_T *buf, int forceit)
|
||||
{
|
||||
return ( P_HID(buf)
|
||||
return ( buf_hide(buf)
|
||||
|| !bufIsChanged(buf)
|
||||
|| buf->b_nwindows > 1
|
||||
|| autowrite(buf, forceit) == OK
|
||||
@@ -2180,7 +2180,14 @@ check_changed_any(
|
||||
msg_col = 0;
|
||||
msg_didout = FALSE;
|
||||
}
|
||||
if (EMSG2(_("E162: No write since last change for buffer \"%s\""),
|
||||
if (
|
||||
#ifdef FEAT_TERMINAL
|
||||
term_job_running(buf->b_term)
|
||||
? EMSG2(_("E947: Job still running in buffer \"%s\""),
|
||||
buf->b_fname)
|
||||
:
|
||||
#endif
|
||||
EMSG2(_("E162: No write since last change for buffer \"%s\""),
|
||||
buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname))
|
||||
{
|
||||
save = no_wait_return;
|
||||
@@ -2734,13 +2741,13 @@ do_argfile(exarg_T *eap, int argn)
|
||||
* the same buffer
|
||||
*/
|
||||
other = TRUE;
|
||||
if (P_HID(curbuf))
|
||||
if (buf_hide(curbuf))
|
||||
{
|
||||
p = fix_fname(alist_name(&ARGLIST[argn]));
|
||||
other = otherfile(p);
|
||||
vim_free(p);
|
||||
}
|
||||
if ((!P_HID(curbuf) || !other)
|
||||
if ((!buf_hide(curbuf) || !other)
|
||||
&& check_changed(curbuf, CCGD_AW
|
||||
| (other ? 0 : CCGD_MULTWIN)
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
@@ -2761,7 +2768,7 @@ do_argfile(exarg_T *eap, int argn)
|
||||
* argument index. */
|
||||
if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL,
|
||||
eap, ECMD_LAST,
|
||||
(P_HID(curwin->w_buffer) ? ECMD_HIDE : 0)
|
||||
(buf_hide(curwin->w_buffer) ? ECMD_HIDE : 0)
|
||||
+ (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL)
|
||||
curwin->w_arg_idx = old_arg_idx;
|
||||
/* like Vi: set the mark where the cursor is in the file. */
|
||||
@@ -2782,7 +2789,7 @@ ex_next(exarg_T *eap)
|
||||
* check for changed buffer now, if this fails the argument list is not
|
||||
* redefined.
|
||||
*/
|
||||
if ( P_HID(curbuf)
|
||||
if ( buf_hide(curbuf)
|
||||
|| eap->cmdidx == CMD_snext
|
||||
|| !check_changed(curbuf, CCGD_AW
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
@@ -2937,7 +2944,7 @@ ex_listdo(exarg_T *eap)
|
||||
|
||||
if (eap->cmdidx == CMD_windo
|
||||
|| eap->cmdidx == CMD_tabdo
|
||||
|| P_HID(curbuf)
|
||||
|| buf_hide(curbuf)
|
||||
|| !check_changed(curbuf, CCGD_AW
|
||||
| (eap->forceit ? CCGD_FORCEIT : 0)
|
||||
| CCGD_EXCMD))
|
||||
|
Reference in New Issue
Block a user