fix(spell): wrong VimEnter autocommands (#36339)

This commit is contained in:
zeertzjq
2025-10-27 08:13:06 +08:00
committed by GitHub
parent f0cf488698
commit 9436e7c978

View File

@@ -1607,10 +1607,10 @@ static void spell_load_lang(char *lang)
if (r == FAIL) { if (r == FAIL) {
if (starting) { if (starting) {
// Prompt the user at VimEnter if spell files are missing. #3027 // Prompt the user at VimEnter if spell files are missing. #3027
// Plugins aren't loaded yet, so spellfile.vim cannot handle this case. // Plugins aren't loaded yet, so nvim/spellfile.lua cannot handle this case.
char autocmd_buf[512] = { 0 }; char autocmd_buf[512] = { 0 };
snprintf(autocmd_buf, sizeof(autocmd_buf), snprintf(autocmd_buf, sizeof(autocmd_buf),
"autocmd VimEnter * call spellfile#LoadFile('%s')|set spell", "autocmd VimEnter * call v:lua.require'nvim.spellfile'.load_file('%s')|set spell",
lang); lang);
do_cmdline_cmd(autocmd_buf); do_cmdline_cmd(autocmd_buf);
} else { } else {