vim-patch:8.2.0004: get E685 and E931 if buffer reload is interrupted

Problem:    Get E685 and E931 if buffer reload is interrupted.
Solution:   Do not abort deleting a dummy buffer. (closes vim/vim#5361)
a6e8f888e7
This commit is contained in:
zeertzjq
2022-04-07 21:46:07 +08:00
parent 8f3245dbfa
commit 44b59d1a69
9 changed files with 82 additions and 51 deletions

View File

@@ -2527,9 +2527,9 @@ int do_ecmd(int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T new
// Close the link to the current buffer. This will set
// oldwin->w_buffer to NULL.
u_sync(false);
const bool did_decrement = close_buffer(oldwin, curbuf,
(flags & ECMD_HIDE) || curbuf->terminal ? 0 : DOBUF_UNLOAD,
false);
const bool did_decrement
= close_buffer(oldwin, curbuf, (flags & ECMD_HIDE) || curbuf->terminal ? 0 : DOBUF_UNLOAD,
false, false);
// Autocommands may have closed the window.
if (win_valid(the_curwin)) {