spell: Defer &spell prompt until VimEnter. #3027

Closes #1551
This commit is contained in:
Felipe Morales 2015-07-16 22:26:58 -03:00 committed by Justin M. Keyes
parent 883b78d298
commit 5e9f9a8756

View File

@ -2328,8 +2328,16 @@ static void spell_load_lang(char_u *lang)
}
if (r == FAIL) {
smsg(_("Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\""),
lang, spell_enc(), lang);
if (starting) {
// Some startup file sets &spell, but the necessary files don't exist:
// try to prompt the user at VimEnter. Also set spell again. #3027
do_cmdline_cmd(
"autocmd VimEnter * call spellfile#LoadFile(&spelllang)|set spell");
} else {
smsg(
_("Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\""),
lang, spell_enc(), lang);
}
} else if (sl.sl_slang != NULL) {
// At least one file was loaded, now load ALL the additions.
STRCPY(fname_enc + STRLEN(fname_enc) - 3, "add.spl");