-
Notifications
You must be signed in to change notification settings - Fork 11
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bufhiddenを設定するとBufUnloadが2回実行される #912
Labels
Comments
これで様子を見てみて下さい。 diff --git a/src/buffer.c b/src/buffer.c
index 9bc24bc..170e214 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -574,9 +574,12 @@ buf_freeall(buf_T *buf, int flags)
int is_curbuf = (buf == curbuf);
buf->b_closing = TRUE;
- apply_autocmds(EVENT_BUFUNLOAD, buf->b_fname, buf->b_fname, FALSE, buf);
- if (!buf_valid(buf)) /* autocommands may delete the buffer */
- return;
+ if (buf->b_ml.ml_mfp != NULL)
+ {
+ apply_autocmds(EVENT_BUFUNLOAD, buf->b_fname, buf->b_fname, FALSE, buf);
+ if (!buf_valid(buf)) /* autocommands may delete the buffer */
+ return;
+ }
if ((flags & BFA_DEL) && buf->b_p_bl)
{
apply_autocmds(EVENT_BUFDELETE, buf->b_fname, buf->b_fname, FALSE, buf); |
これ系多いすね。まだありそう。。。 |
@h-east patch適用後、BufUnloadが2回発生しなくなりました。 |
testを追加してvim_devに投げました。 |
patch 7.4.1837 👍 @norio13 issue登録ありがとうございました。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
質問・報告の内容
bufhiddenオプションにunload、deleteのどちらかが設定されたバッファに対して、
:bunload、:bdelete、:bwipeoutを実行するとBufUnloadが2回発火されました。
bufhiddenの値がhideとwipeまたは値なしの場合、上記3つのコマンドを実行してもBufUnloadは1回のみ発火します。
再現方法
Vim起動
test.vimの内容
Vimのバージョン
7.4.1830
OSの種類
OSのディストリ
Debian
OSのバージョン
8.4
The text was updated successfully, but these errors were encountered: