mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 17:36:29 +00:00
fix(colorscheme): try .lua files in 'rtp' before .vim files in 'pp' (#23727)
This ensures that colorschemes in 'rtp' are tried before ones in 'pp', because some colorschemes in 'pp' may not work if not added to 'rtp'. This also match the current documentation better.
This commit is contained in:
@@ -697,10 +697,18 @@ int load_colors(char *name)
|
||||
char *buf = xmalloc(buflen);
|
||||
apply_autocmds(EVENT_COLORSCHEMEPRE, name, curbuf->b_fname, false, curbuf);
|
||||
snprintf(buf, buflen, "colors/%s.vim", name);
|
||||
int retval = source_runtime(buf, DIP_START + DIP_OPT);
|
||||
int retval = source_runtime(buf, 0);
|
||||
if (retval == FAIL) {
|
||||
snprintf(buf, buflen, "colors/%s.lua", name);
|
||||
retval = source_runtime(buf, DIP_START + DIP_OPT);
|
||||
retval = source_runtime(buf, 0);
|
||||
}
|
||||
if (retval == FAIL) {
|
||||
snprintf(buf, buflen, "colors/%s.vim", name);
|
||||
retval = source_runtime(buf, DIP_NORTP + DIP_START + DIP_OPT);
|
||||
}
|
||||
if (retval == FAIL) {
|
||||
snprintf(buf, buflen, "colors/%s.lua", name);
|
||||
retval = source_runtime(buf, DIP_NORTP + DIP_START + DIP_OPT);
|
||||
}
|
||||
xfree(buf);
|
||||
if (retval == OK) {
|
||||
|
Reference in New Issue
Block a user