From 5e9f9a875645af1e3c858daba799fe4a9021a767 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Thu, 16 Jul 2015 22:26:58 -0300 Subject: [PATCH] spell: Defer &spell prompt until VimEnter. #3027 Closes #1551 --- src/nvim/spell.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/nvim/spell.c b/src/nvim/spell.c index acff14bc40..f9ed6faff9 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -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");