fix: correct runtimepath order (#4124)

This commit is contained in:
LostNeophyte 2023-05-07 10:36:42 +02:00 committed by GitHub
parent 55e7fdb9d1
commit 6d3f8b2183
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View file

@ -5,7 +5,7 @@ local base_dir = vim.env.LUNARVIM_BASE_DIR
end)()
if not vim.tbl_contains(vim.opt.rtp:get(), base_dir) then
vim.opt.rtp:append(base_dir)
vim.opt.rtp:prepend(base_dir)
end
require("lvim.bootstrap"):init(base_dir)

View file

@ -42,8 +42,19 @@ function plugin_loader.init(opts)
vim.api.nvim_create_autocmd("User", { pattern = "LazyDone", callback = require("lvim.lsp").setup })
end
vim.opt.runtimepath:append(lazy_install_dir)
vim.opt.runtimepath:append(join_paths(plugins_dir, "*"))
local rtp = vim.opt.rtp:get()
local base_dir = (vim.env.LUNARVIM_BASE_DIR or get_runtime_dir() .. "/lvim"):gsub("\\", "/")
local idx_base = #rtp + 1
for i, path in ipairs(rtp) do
path = path:gsub("\\", "/")
if path == base_dir then
idx_base = i + 1
break
end
end
table.insert(rtp, idx_base, lazy_install_dir)
table.insert(rtp, idx_base + 1, join_paths(plugins_dir, "*"))
vim.opt.rtp = rtp
pcall(function()
-- set a custom path for lazy's cache