vim-patch:8.0.1777: cannot cleanup before loading another colorscheme (#9104)

Problem:    Cannot cleanup before loading another colorscheme.
Solution:   Add the ColorSchemePre autocommand event.
60a68362aa
This commit is contained in:
Jan Edmund Lazo
2018-10-11 02:27:37 -04:00
committed by Justin M. Keyes
parent e17e21e4cf
commit 2bf1aa5628
4 changed files with 16 additions and 2 deletions

View File

@@ -6326,6 +6326,7 @@ int load_colors(char_u *name)
recursive = true;
size_t buflen = STRLEN(name) + 12;
buf = xmalloc(buflen);
apply_autocmds(EVENT_COLORSCHEMEPRE, name, curbuf->b_fname, false, curbuf);
snprintf((char *)buf, buflen, "colors/%s.vim", name);
retval = source_runtime(buf, DIP_START + DIP_OPT);
xfree(buf);