aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-13 15:49:33 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-08-14 04:29:44 +0800
commita10a23aae91a8356b36ac63f0917a556cfcaf976 (patch)
treeea3a4fd393a991badd98b588c5edc64f82dc7c9b /src/nvim/testdir
parent3a8b8591477b4802af73436e93bd1283d4bab518 (diff)
downloadrneovim-a10a23aae91a8356b36ac63f0917a556cfcaf976.tar.gz
rneovim-a10a23aae91a8356b36ac63f0917a556cfcaf976.tar.bz2
rneovim-a10a23aae91a8356b36ac63f0917a556cfcaf976.zip
vim-patch:8.2.0097: crash with autocommand and spellfile
Problem: Crash with autocommand and spellfile. (Tim Pope) Solution: Do not pop exestack when not pushed. (closes vim/vim#5450) https://github.com/vim/vim/commit/ce6db0273f2c4359f48d75103a42991aa481f14e
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_autocmd.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 1c2f86a584..89e3c9927b 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -2614,6 +2614,28 @@ func Test_BufWrite_lockmarks()
call delete('Xtest2')
endfunc
+func Test_FileType_spell()
+ if !isdirectory('/tmp')
+ throw "Skipped: requires /tmp directory"
+ endif
+
+ " this was crashing with an invalid free()
+ setglobal spellfile=/tmp/en.utf-8.add
+ augroup crash
+ autocmd!
+ autocmd BufNewFile,BufReadPost crashfile setf somefiletype
+ autocmd BufNewFile,BufReadPost crashfile set ft=anotherfiletype
+ autocmd FileType anotherfiletype setlocal spell
+ augroup END
+ func! NoCrash() abort
+ edit /tmp/crashfile
+ endfunc
+ call NoCrash()
+
+ au! crash
+ setglobal spellfile=
+endfunc
+
" Test closing a window or editing another buffer from a FileChangedRO handler
" in a readonly buffer
func Test_FileChangedRO_winclose()