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:
zeertzjq
2025-12-12 08:54:18 +08:00
parent 2b02dfa020
commit e9da68effe
2 changed files with 12 additions and 0 deletions

View File

@@ -228,6 +228,13 @@ func Test_buffer_error()
%bwipe
endfunc
func Test_bwipe_during_save()
set charconvert=execute('%bw!')
call assert_fails('write ++enc=lmao boom', 'E937:')
%bwipe
endfunc
" Test for the status messages displayed when unloading, deleting or wiping
" out buffers
func Test_buffer_statusmsg()