:set shortmess+=F
:au BufUnload * echo "BufUnload " . expand("%")
:e test
:tab drop test
"BufUnload test" is printed but it should not be printed.
9.0
Mac, WSL
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
This seems to be a regression from patch 9.1.0046.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Note: tab drop does not trigger BufUnload on 9.0. But, e does trigger BufUnload on 9.0.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Also, this still happens for :drop if test is an empty file, but doesn't happen if test is non-empty.
That is because of 9781788
I am not sure what the correct behaviour should be. If we comment out part of the patch that triggers ex_rewind, it won't trigger the BufUnload anymore, but the file would also not be loaded. So I think it should go through do_ecmd() (which will then trigger the BufUnload again).
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
How about changing the file ex_cmds.c in line 5749
ex_all(eap); cmdmod.cmod_tab = 0; ex_rewind(eap);
to
ex_all(eap); cmdmod.cmod_tab = 0; open_buffer(FALSE, eap, 0);
If do so, the problem when call :tab drop test seems to be fixed, and the file loads well on my computer.
I'm not familiar with the vim kernel but this solution works on my computer.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
IIRC that open_buffer leaked memory, see the details in the commits mentioned above.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()