fix(terminal): :edit should respect 'bufhidden' with exited job (#37301)

This commit is contained in:
zeertzjq
2026-01-10 08:25:49 +08:00
committed by GitHub
parent d1f7672bc9
commit 295fb3fdb2
2 changed files with 92 additions and 55 deletions

View File

@@ -2601,7 +2601,10 @@ int do_ecmd(int fnum, char *ffname, char *sfname, exarg_T *eap, linenr_T newlnum
// oldwin->w_buffer to NULL.
u_sync(false);
const bool did_decrement
= close_buffer(oldwin, curbuf, (flags & ECMD_HIDE) || curbuf->terminal ? 0 : DOBUF_UNLOAD,
= close_buffer(oldwin, curbuf,
(flags & ECMD_HIDE)
|| (curbuf->terminal && terminal_running(curbuf->terminal))
? 0 : DOBUF_UNLOAD,
false, false);
// Autocommands may have closed the window.