aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/funcs.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-05 07:44:25 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-08-05 07:53:54 +0800
commitd985323c555b894e0a6eb8bb283bb0318467c476 (patch)
tree5907de97d49210004aa39055342b71a16de70d4c /src/nvim/eval/funcs.c
parentc1e1d16fcac0daa8b5796a3a5d11271fbb89ccbb (diff)
downloadrneovim-d985323c555b894e0a6eb8bb283bb0318467c476.tar.gz
rneovim-d985323c555b894e0a6eb8bb283bb0318467c476.tar.bz2
rneovim-d985323c555b894e0a6eb8bb283bb0318467c476.zip
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. https://github.com/vim/vim/commit/5e94a29ebbde10dd973d58f1adba9a2fc83877d1
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r--src/nvim/eval/funcs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index b3cfec8709..d121c106d0 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -9914,7 +9914,11 @@ static void f_termopen(typval_T *argvars, typval_T *rettv, FunPtr fptr)
// at this point the buffer has no terminal instance associated yet, so unset
// the 'swapfile' option to ensure no swap file will be created
curbuf->b_p_swf = false;
+
+ apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, false, curbuf);
(void)setfname(curbuf, (char *)NameBuff, NULL, true);
+ apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, false, curbuf);
+
// Save the job id and pid in b:terminal_job_{id,pid}
Error err = ERROR_INIT;
// deprecated: use 'channel' buffer option