patch 8.0.1777: cannot cleanup before loading another colorscheme
Problem: Cannot cleanup before loading another colorscheme.
Solution: Add the ColorSchemePre autocommand event.
diff --git a/src/syntax.c b/src/syntax.c
index e945dac..bb695b5 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -7224,6 +7224,8 @@
buf = alloc((unsigned)(STRLEN(name) + 12));
if (buf != NULL)
{
+ apply_autocmds(EVENT_COLORSCHEMEPRE, name,
+ curbuf->b_fname, FALSE, curbuf);
sprintf((char *)buf, "colors/%s.vim", name);
retval = source_runtime(buf, DIP_START + DIP_OPT);
vim_free(buf);