diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-31 21:17:10 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-31 21:17:10 +0100 |
commit | 5d09a401ec393dc930e1104ceb38eab34681de64 (patch) | |
tree | 2b9f540edb9197ecaf64fd308cd35c354a65bf45 /src/highlight.c | |
parent | 21c3a80a7fd6b7fc250ce5dc287963511f54b86f (diff) |
patch 9.0.0343: ColorScheme autocommand triggered when colorscheme not foundv9.0.0343
Problem: ColorScheme autocommand triggered when colorscheme is not found.
(Romain Lafourcade)
Solution: Only trigger ColorScheme when loading the colorscheme succeeds.
(closes #11024)
Diffstat (limited to 'src/highlight.c')
-rw-r--r-- | src/highlight.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/highlight.c b/src/highlight.c index 95cdb46b5a..303d5c294f 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -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; |