diff options
Diffstat (limited to 'src/nvim/spell.c')
| -rw-r--r-- | src/nvim/spell.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c index 63fc7b80a7..f9ed6faff9 100644 --- a/src/nvim/spell.c +++ b/src/nvim/spell.c @@ -331,7 +331,7 @@ #include "nvim/os/os.h" #include "nvim/os/input.h" -#ifndef UNIX // it's in os_unix_defs.h for Unix +#ifndef UNIX // it's in os/unix_defs.h for Unix # include <time.h> // for time_t #endif @@ -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"); @@ -4116,7 +4124,7 @@ static int badword_captype(char_u *word, char_u *end) // Delete the internal wordlist and its .spl file. void spell_delete_wordlist(void) { - char_u fname[MAXPATHL]; + char_u fname[MAXPATHL] = {0}; if (int_wordlist != NULL) { os_remove((char *)int_wordlist); |