1
0
forked from aniani/vim

patch 9.0.0343: ColorScheme autocommand triggered when colorscheme not found

Problem:    ColorScheme autocommand triggered when colorscheme is not found.
            (Romain Lafourcade)
Solution:   Only trigger ColorScheme when loading the colorscheme succeeds.
            (closes #11024)
This commit is contained in:
Bram Moolenaar
2022-08-31 21:17:10 +01:00
parent 21c3a80a7f
commit 5d09a401ec
3 changed files with 15 additions and 3 deletions

View File

@@ -507,7 +507,9 @@ load_colors(char_u *name)
sprintf((char *)buf, "colors/%s.vim", name);
retval = source_runtime(buf, DIP_START + DIP_OPT);
vim_free(buf);
apply_autocmds(EVENT_COLORSCHEME, name, curbuf->b_fname, FALSE, curbuf);
if (retval == OK)
apply_autocmds(EVENT_COLORSCHEME, name, curbuf->b_fname,
FALSE, curbuf);
}
recursive = FALSE;