Mercurial > vim
comparison src/testdir/test_autocmd.vim @ 30558:8e73ecbee60d v9.0.0614
patch 9.0.0614: SpellFileMissing autocmd may delete buffer
Commit: https://github.com/vim/vim/commit/ef976323e770315b5fca544efb6b2faa25674d15
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 28 11:48:30 2022 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 28 Sep 2022 13:00:04 +0200 |
parents | 7ab65e398be7 |
children | ac908e454519 |
comparison
equal
deleted
inserted
replaced
30557:cb23c106452e | 30558:8e73ecbee60d |
---|---|
2878 | 2878 |
2879 au! crash | 2879 au! crash |
2880 setglobal spellfile= | 2880 setglobal spellfile= |
2881 endfunc | 2881 endfunc |
2882 | 2882 |
2883 " this was wiping out the current buffer and using freed memory | |
2884 func Test_SpellFileMissing_bwipe() | |
2885 next 0 | |
2886 au SpellFileMissing 0 bwipe | |
2887 call assert_fails('set spell spelllang=0', 'E937:') | |
2888 | |
2889 au! SpellFileMissing | |
2890 bwipe | |
2891 endfunc | |
2892 | |
2883 " Test closing a window or editing another buffer from a FileChangedRO handler | 2893 " Test closing a window or editing another buffer from a FileChangedRO handler |
2884 " in a readonly buffer | 2894 " in a readonly buffer |
2885 func Test_FileChangedRO_winclose() | 2895 func Test_FileChangedRO_winclose() |
2886 call test_override('ui_delay', 10) | 2896 call test_override('ui_delay', 10) |
2887 | 2897 |