diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-10-15 16:10:56 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-10-15 16:28:36 +0800 |
commit | 6bc2d6b66b683faedded01128af8ad98b7130fef (patch) | |
tree | d0986b71d8922178c32e010bf4b5615f0e0d1cc9 /test | |
parent | 65cbe0cc35c07a929152b86e78717efa4ba155da (diff) | |
download | rneovim-6bc2d6b66b683faedded01128af8ad98b7130fef.tar.gz rneovim-6bc2d6b66b683faedded01128af8ad98b7130fef.tar.bz2 rneovim-6bc2d6b66b683faedded01128af8ad98b7130fef.zip |
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.
https://github.com/vim/vim/commit/ef976323e770315b5fca544efb6b2faa25674d15
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/autocmd/termxx_spec.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/functional/autocmd/termxx_spec.lua b/test/functional/autocmd/termxx_spec.lua index 859c2ebf44..a38f9cb0ac 100644 --- a/test/functional/autocmd/termxx_spec.lua +++ b/test/functional/autocmd/termxx_spec.lua @@ -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 |