1
0
forked from aniani/vim

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.
This commit is contained in:
Bram Moolenaar
2020-03-19 18:46:57 +01:00
parent 37f471df6e
commit 5e94a29ebb
7 changed files with 119 additions and 50 deletions

View File

@@ -523,6 +523,8 @@ term_start(
term->tl_next = first_term;
first_term = term;
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
if (opt->jo_term_name != NULL)
curbuf->b_ffname = vim_strsave(opt->jo_term_name);
else if (argv != NULL)
@@ -571,6 +573,8 @@ term_start(
curbuf->b_sfname = vim_strsave(curbuf->b_ffname);
curbuf->b_fname = curbuf->b_ffname;
apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf);
if (opt->jo_term_opencmd != NULL)
term->tl_opencmd = vim_strsave(opt->jo_term_opencmd);