mirror of
https://github.com/neovim/neovim.git
synced 2026-07-30 12:28:06 +00:00
vim-patch:9.0.0614: SpellFileMissing autocmd may delete buffer
Problem: SpellFileMissing autocmd may delete buffer.
Solution: Disallow deleting the current buffer to avoid using freed memory.
ef976323e7
This commit is contained in:
@@ -2752,6 +2752,16 @@ func Test_FileType_spell()
|
||||
setglobal spellfile=
|
||||
endfunc
|
||||
|
||||
" this was wiping out the current buffer and using freed memory
|
||||
func Test_SpellFileMissing_bwipe()
|
||||
next 0
|
||||
au SpellFileMissing 0 bwipe
|
||||
call assert_fails('set spell spelllang=0', 'E937:')
|
||||
|
||||
au! SpellFileMissing
|
||||
bwipe
|
||||
endfunc
|
||||
|
||||
" Test closing a window or editing another buffer from a FileChangedRO handler
|
||||
" in a readonly buffer
|
||||
func Test_FileChangedRO_winclose()
|
||||
|
||||
Reference in New Issue
Block a user