mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 17:06:30 +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
(cherry picked from commit6bc2d6b66b
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
8595f0298a
commit
7ba968ef3b
@@ -5,6 +5,7 @@ local clear, command, nvim, testprg =
|
||||
helpers.clear, helpers.command, helpers.nvim, helpers.testprg
|
||||
local eval, eq, neq, retry =
|
||||
helpers.eval, helpers.eq, helpers.neq, helpers.retry
|
||||
local matches = helpers.matches
|
||||
local ok = helpers.ok
|
||||
local feed = helpers.feed
|
||||
local pcall_err = helpers.pcall_err
|
||||
@@ -22,7 +23,8 @@ describe('autocmd TermClose', function()
|
||||
local function test_termclose_delete_own_buf()
|
||||
command('autocmd TermClose * bdelete!')
|
||||
command('terminal')
|
||||
eq('Vim(bdelete):E937: Attempt to delete a buffer that is in use', pcall_err(command, 'bdelete!'))
|
||||
matches('^Vim%(bdelete%):E937: Attempt to delete a buffer that is in use: term://',
|
||||
pcall_err(command, 'bdelete!'))
|
||||
assert_alive()
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user