diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2016-04-10 04:52:10 -0400 | 
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2016-04-10 04:52:10 -0400 | 
| commit | 91c5005da82e6f9ab6bb2f46b27cb82b188b0391 (patch) | |
| tree | 8ffe1898284a6e76aed87e4cdd8f64ef87b2e298 /src/nvim/spell.c | |
| parent | 1bf1ffc7346c0cc8e8ef337fd94badd3a530e90e (diff) | |
| parent | 8d37201ed29a4149ff87b17e7ade209a0981986a (diff) | |
| download | rneovim-91c5005da82e6f9ab6bb2f46b27cb82b188b0391.tar.gz rneovim-91c5005da82e6f9ab6bb2f46b27cb82b188b0391.tar.bz2 rneovim-91c5005da82e6f9ab6bb2f46b27cb82b188b0391.zip  | |
Merge pull request #4555 from justinmk/spell
spell: fix SpellFileMissing handler
Diffstat (limited to 'src/nvim/spell.c')
| -rw-r--r-- | src/nvim/spell.c | 13 | 
1 files changed, 8 insertions, 5 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c index cc7dc6210c..fdae89b84c 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -2332,14 +2332,17 @@ static void spell_load_lang(char_u *lang)    if (r == FAIL) {      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"); +      // Prompt the user at VimEnter if spell files are missing. #3027 +      // Plugins aren't loaded yet, so spellfile.vim cannot handle this case. +      char autocmd_buf[128] = { 0 }; +      snprintf(autocmd_buf, sizeof(autocmd_buf), +               "autocmd VimEnter * call spellfile#LoadFile('%s')|set spell", +               lang); +      do_cmdline_cmd(autocmd_buf);      } else {        smsg(          _("Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\""), -	    lang, spell_enc(), lang); +        lang, spell_enc(), lang);      }    } else if (sl.sl_slang != NULL) {      // At least one file was loaded, now load ALL the additions.  | 
