diff --git a/src/ex_cmds.c b/src/ex_cmds.c index cedb9edf88..b2fc85c99e 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -2515,11 +2515,17 @@ do_wqall(exarg_T *eap) #ifdef FEAT_TERMINAL if (exiting && !eap->forceit && term_job_running(buf->b_term)) { + bufref_T bufref; + + set_bufref(&bufref, buf); if (term_try_stop_job(buf) == FAIL) { no_write_message_buf(buf); ++error; } + // Stopping the job may have freed the terminal buffer. + else if (!bufref_valid(&bufref)) + buf = firstbuf; } else #endif diff --git a/src/version.c b/src/version.c index cacb63cb8c..65550ac004 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 594, /**/ 593, /**/