patch 8.2.0413: buffer menu does not handle special buffers properly
Problem: Buffer menu does not handle special buffers properly.
Solution: Keep a dictionary with buffer names to reliably keep track of
entries.
Also trigger BufFilePre and BufFilePost for command-line and
terminal buffers when the name changes.
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 7193a2a..bc3cccc 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4195,7 +4195,9 @@
// Create the command-line buffer empty.
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL);
+ apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
(void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE);
+ apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL);
curbuf->b_p_ma = TRUE;
#ifdef FEAT_FOLDING