Mercurial > vim
comparison src/testdir/test_spell.vim @ 22444:9f4c3e20b5f7 v8.2.1770
patch 8.2.1770: invalid memory use when using SpellFileMissing autocmd
Commit: https://github.com/vim/vim/commit/d569a9e74684cd17f9cea63e804281388728e513
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 28 23:13:15 2020 +0200
patch 8.2.1770: invalid memory use when using SpellFileMissing autocmd
Problem: Invalid memory use when using SpellFileMissing autocmd.
Solution: Add test case. (Dominique Pell?, closes https://github.com/vim/vim/issues/7036) Fix using a window
that was closed.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 28 Sep 2020 23:15:03 +0200 |
parents | 89277634be10 |
children | 107ef099fd57 |
comparison
equal
deleted
inserted
replaced
22443:db8b2b99f59e | 22444:9f4c3e20b5f7 |
---|---|
116 | 116 |
117 call delete('Xwords.spl') | 117 call delete('Xwords.spl') |
118 call delete('Xwords') | 118 call delete('Xwords') |
119 set spelllang& | 119 set spelllang& |
120 set spell& | 120 set spell& |
121 endfunc | |
122 | |
123 func Test_spell_file_missing() | |
124 let s:spell_file_missing = 0 | |
125 augroup TestSpellFileMissing | |
126 autocmd! SpellFileMissing * let s:spell_file_missing += 1 | |
127 augroup END | |
128 | |
129 set spell spelllang=ab_cd | |
130 let messages = GetMessages() | |
131 call assert_equal('Warning: Cannot find word list "ab.utf-8.spl" or "ab.ascii.spl"', messages[-1]) | |
132 call assert_equal(1, s:spell_file_missing) | |
133 | |
134 new XTestSpellFileMissing | |
135 augroup TestSpellFileMissing | |
136 autocmd! SpellFileMissing * bwipe | |
137 augroup END | |
138 call assert_fails('set spell spelllang=ab_cd', 'E797:') | |
139 | |
140 augroup! TestSpellFileMissing | |
141 unlet s:spell_file_missing | |
142 set spell& spelllang& | |
143 %bwipe! | |
121 endfunc | 144 endfunc |
122 | 145 |
123 func Test_spelllang_inv_region() | 146 func Test_spelllang_inv_region() |
124 set spell spelllang=en_xx | 147 set spell spelllang=en_xx |
125 let messages = GetMessages() | 148 let messages = GetMessages() |