mirror of
https://github.com/neovim/neovim.git
synced 2026-08-27 09:31:47 +00:00
vim-patch:9.1.1971: Crash when buffer gets deleted inside charconvert during save
Problem: Crash when buffer gets deleted inside charconvert during save
Solution: Check for `b_saving` inside `can_unload_buffer()`, so we don’t try to
unload a buffer while it’s still being saved (glepnir).
closes: vim/vim#18901
fe1c57cd2c
Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
@@ -479,6 +479,11 @@ static bool can_unload_buffer(buf_T *buf)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Don't unload the buffer while it's still being saved
|
||||
if (can_unload && buf->b_saving) {
|
||||
can_unload = false;
|
||||
}
|
||||
|
||||
if (!can_unload) {
|
||||
char *fname = buf->b_fname != NULL ? buf->b_fname : buf->b_ffname;
|
||||
semsg(_(e_attempt_to_delete_buffer_that_is_in_use_str),
|
||||
|
||||
Reference in New Issue
Block a user