aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/buffer.c17
-rw-r--r--src/nvim/ex_cmds.c7
-rw-r--r--src/nvim/ex_cmds2.c8
3 files changed, 25 insertions, 7 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index ffa44c33cd..839d61cd2e 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1637,12 +1637,23 @@ void do_autochdir(void)
void no_write_message(void)
{
- EMSG(_("E37: No write since last change (add ! to override)"));
+ if (curbuf->terminal
+ && channel_job_running((uint64_t)curbuf->b_p_channel)) {
+ EMSG(_("E948: Job still running (add ! to end the job)"));
+ } else {
+ EMSG(_("E37: No write since last change (add ! to override)"));
+ }
}
-void no_write_message_nobang(void)
+void no_write_message_nobang(const buf_T *const buf)
+ FUNC_ATTR_NONNULL_ALL
{
- EMSG(_("E37: No write since last change"));
+ if (buf->terminal
+ && channel_job_running((uint64_t)buf->b_p_channel)) {
+ EMSG(_("E948: Job still running"));
+ } else {
+ EMSG(_("E37: No write since last change"));
+ }
}
//
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index d2ccbe3e6d..b0a51eaefd 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -1965,7 +1965,12 @@ void do_wqall(exarg_T *eap)
}
FOR_ALL_BUFFERS(buf) {
- if (!bufIsChanged(buf) || bt_dontwrite(buf)) {
+ if (exiting
+ && buf->terminal
+ && channel_job_running((uint64_t)buf->b_p_channel)) {
+ no_write_message_nobang(buf);
+ error++;
+ } else if (!bufIsChanged(buf) || bt_dontwrite(buf)) {
continue;
}
/*
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 6b03117ff3..3b9c44c3cd 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -1297,7 +1297,7 @@ bool check_changed(buf_T *buf, int flags)
if (flags & CCGD_EXCMD) {
no_write_message();
} else {
- no_write_message_nobang();
+ no_write_message_nobang(curbuf);
}
return true;
}
@@ -1503,8 +1503,10 @@ bool check_changed_any(bool hidden, bool unload)
msg_col = 0;
msg_didout = false;
}
- if (EMSG2(_("E162: No write since last change for buffer \"%s\""),
- buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname)) {
+ if ((buf->terminal && channel_job_running((uint64_t)buf->b_p_channel))
+ ? EMSG2(_("E947: Job still running in buffer \"%s\""), buf->b_fname)
+ : EMSG2(_("E162: No write since last change for buffer \"%s\""),
+ buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname)) {
save = no_wait_return;
no_wait_return = false;
wait_return(false);