Patch 8.2.1770
Problem: Invalid memory use when using SpellFileMissing autocmd.
Solution: Add test case. (Dominique Pellé, closes #7036) Fix using a window
that was closed.
Files: src/spell.c, src/testdir/test_spell.vim
*** ../vim-8.2.1769/src/spell.c 2020-09-16 17:30:23.789724893 +0200
--- src/spell.c 2020-09-28 23:11:02.259089664 +0200
***************
*** 2280,2290 ****
}
}
}
theend:
vim_free(spl_copy);
recursive = FALSE;
- redraw_win_later(wp, NOT_VALID);
return ret_msg;
}
--- 2280,2290 ----
}
}
}
+ redraw_win_later(wp, NOT_VALID);
theend:
vim_free(spl_copy);
recursive = FALSE;
return ret_msg;
}
*** ../vim-8.2.1769/src/testdir/test_spell.vim 2020-09-27 13:58:33.342697775 +0200
--- src/testdir/test_spell.vim 2020-09-28 22:57:07.449488501 +0200
***************
*** 120,125 ****
--- 120,148 ----
set spell&
endfunc
+ func Test_spell_file_missing()
+ let s:spell_file_missing = 0
+ augroup TestSpellFileMissing
+ autocmd! SpellFileMissing * let s:spell_file_missing += 1
+ augroup END
+
+ set spell spelllang=ab_cd
+ let messages = GetMessages()
+ call assert_equal('Warning: Cannot find word list "ab.utf-8.spl" or "ab.ascii.spl"', messages[-1])
+ call assert_equal(1, s:spell_file_missing)
+
+ new XTestSpellFileMissing
+ augroup TestSpellFileMissing
+ autocmd! SpellFileMissing * bwipe
+ augroup END
+ call assert_fails('set spell spelllang=ab_cd', 'E797:')
+
+ augroup! TestSpellFileMissing
+ unlet s:spell_file_missing
+ set spell& spelllang&
+ %bwipe!
+ endfunc
+
func Test_spelllang_inv_region()
set spell spelllang=en_xx
let messages = GetMessages()
*** ../vim-8.2.1769/src/version.c 2020-09-28 22:29:25.425766287 +0200
--- src/version.c 2020-09-28 23:12:53.346755522 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1770,
/**/
--
hundred-and-one symptoms of being an internet addict:
12. You turn off your Wifi and get this awful empty feeling, like you just
pulled the plug on a loved one.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language --
http://www.Zimbu.org ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///