diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-07-04 09:18:19 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-07-04 09:22:50 -0400 |
commit | 0d75b0d8d470fdf763743823feb6d9013eff069c (patch) | |
tree | 627a666e896a110455623114846c78875852853b /src/nvim/buffer.c | |
parent | ce4d424bfc92d7308d1edecd723d2f20cef6c2c0 (diff) | |
download | rneovim-0d75b0d8d470fdf763743823feb6d9013eff069c.tar.gz rneovim-0d75b0d8d470fdf763743823feb6d9013eff069c.tar.bz2 rneovim-0d75b0d8d470fdf763743823feb6d9013eff069c.zip |
vim-patch:8.2.3097: crash when using "quit" at recovery prompt
Problem: Crash when using "quit" at recovery prompt and autocommands are
triggered.
Solution: Block autocommands when creating an empty buffer to use as the
current buffer. (closes vim/vim#8506)
https://github.com/vim/vim/commit/1d97efce0ce31ddf0dd4c1ae2228ef4caee6880c
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index f1f32076bf..8decd02b3a 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -901,7 +901,10 @@ void handle_swap_exists(bufref_T *old_curbuf) if (old_curbuf == NULL || !bufref_valid(old_curbuf) || old_curbuf->br_buf == curbuf) { + // Block autocommands here because curwin->w_buffer is NULL. + block_autocmds(); buf = buflist_new(NULL, NULL, 1L, BLN_CURBUF | BLN_LISTED); + unblock_autocmds(); } else { buf = old_curbuf->br_buf; } |