aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/runtime_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-23 16:12:16 +0800
committerGitHub <noreply@github.com>2023-05-23 16:12:16 +0800
commit62e0e0349c00c2c1fa1e5ec09aa7028f12ed329b (patch)
treed437b44d70bfac332de3ea0f480d12f8fca1b3d2 /test/functional/lua/runtime_spec.lua
parent07883940b2294e0ab32fb58e6624d18d9dd1715a (diff)
downloadrneovim-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 'test/functional/lua/runtime_spec.lua')
-rw-r--r--test/functional/lua/runtime_spec.lua32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/functional/lua/runtime_spec.lua b/test/functional/lua/runtime_spec.lua
index 72c99ac1f3..cd19ea4e49 100644
--- a/test/functional/lua/runtime_spec.lua
+++ b/test/functional/lua/runtime_spec.lua
@@ -61,6 +61,38 @@ describe('runtime:', function()
eq('vim', eval('g:colorscheme'))
end)
+
+ it("loads lua colorscheme in 'rtp' if vim version only exists in 'pp' #23724", function()
+ local pack_dir = 'Test_Pack'
+ mkdir_p(pack_dir)
+ finally(function()
+ rmdir(pack_dir)
+ end)
+ exec('set pp+=' .. pack_dir)
+
+ local pack_opt_dir = pack_dir .. sep .. 'pack' .. sep .. 'some_name' .. sep .. 'opt'
+ local colors_opt_dir = pack_opt_dir .. sep .. 'some_pack' .. sep .. 'colors'
+ mkdir_p(colors_opt_dir)
+
+ local rtp_colorscheme_file = colorscheme_folder .. sep .. 'new_colorscheme'
+ local pp_opt_colorscheme_file = colors_opt_dir .. sep .. 'new_colorscheme'
+
+ write_file(pp_opt_colorscheme_file .. '.lua', [[vim.g.colorscheme = 'lua_pp']])
+ exec('colorscheme new_colorscheme')
+ eq('lua_pp', eval('g:colorscheme'))
+
+ write_file(pp_opt_colorscheme_file .. '.vim', [[let g:colorscheme = 'vim_pp']])
+ exec('colorscheme new_colorscheme')
+ eq('vim_pp', eval('g:colorscheme'))
+
+ write_file(rtp_colorscheme_file .. '.lua', [[vim.g.colorscheme = 'lua_rtp']])
+ exec('colorscheme new_colorscheme')
+ eq('lua_rtp', eval('g:colorscheme'))
+
+ write_file(rtp_colorscheme_file .. '.vim', [[let g:colorscheme = 'vim_rtp']])
+ exec('colorscheme new_colorscheme')
+ eq('vim_rtp', eval('g:colorscheme'))
+ end)
end)
describe('compiler', function()