From 5231ad13574a4c5ef65c4480165c984a6e83d0dc Mon Sep 17 00:00:00 2001 From: Barrett Ruth <62671086+barrettruth@users.noreply.github.com> Date: Mon, 6 Jul 2026 20:41:11 -0500 Subject: [PATCH] fix(terminal): avoid E676 after failed :wqa (#40620) --- src/nvim/ex_cmds.c | 1 + test/functional/terminal/buffer_spec.lua | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index dafff2cf49..11d8c74d48 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -2132,6 +2132,7 @@ void do_wqall(exarg_T *eap) && channel_job_running((uint64_t)buf->b_p_channel)) { no_write_message_buf(buf); error++; + continue; } else if (!bufIsChanged(buf) || bt_dontwrite(buf)) { continue; } diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 04db574e6e..060169c4fb 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -16,6 +16,7 @@ local testprg = n.testprg local write_file = t.write_file local command = n.command local matches = t.matches +local not_matches = t.not_matches local exec_lua = n.exec_lua local sleep = vim.uv.sleep local fn = n.fn @@ -239,6 +240,9 @@ describe(':terminal buffer', function() it('requires bang (!) to close a running job #15402', function() eq('Vim(wqall):E948: Job still running (add ! to end the job)', pcall_err(command, 'wqall')) + command('redir => g:wqall_out | silent! wqall | redir END') + matches('E948:', api.nvim_get_var('wqall_out')) + not_matches('E676:', api.nvim_get_var('wqall_out')) for _, cmd in ipairs({ 'bdelete', '%bdelete', 'bwipeout', 'bunload' }) do matches( '^Vim%('