diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-05-23 16:12:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-23 16:12:16 +0800 |
commit | 62e0e0349c00c2c1fa1e5ec09aa7028f12ed329b (patch) | |
tree | d437b44d70bfac332de3ea0f480d12f8fca1b3d2 /src | |
parent | 07883940b2294e0ab32fb58e6624d18d9dd1715a (diff) | |
download | rneovim-62e0e0349c00c2c1fa1e5ec09aa7028f12ed329b.tar.gz rneovim-62e0e0349c00c2c1fa1e5ec09aa7028f12ed329b.tar.bz2 rneovim-62e0e0349c00c2c1fa1e5ec09aa7028f12ed329b.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/highlight_group.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c index 6965c53f59..a17fe2fc8c 100644 --- a/src/nvim/highlight_group.c +++ b/src/nvim/highlight_group.c @@ -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) { |