fix: more robust reloading (#1556)

This commit is contained in:
kylo252 2021-09-16 09:58:32 +02:00 committed by GitHub
parent 168eb232d1
commit e22f9a21c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 93 additions and 36 deletions

View file

@ -38,6 +38,8 @@ function M:init()
self.cache_path = get_cache_dir()
self.pack_dir = join_paths(self.runtime_dir, "site", "pack")
self.packer_install_dir = join_paths(self.runtime_dir, "site", "pack", "packer", "start", "packer.nvim")
self.packer_cache_path = join_paths(self.config_dir, "plugin", "packer_compiled.lua")
if os.getenv "LUNARVIM_RUNTIME_DIR" then
vim.opt.rtp:remove(join_paths(vim.fn.stdpath "data", "site"))
@ -57,6 +59,7 @@ function M:init()
-- FIXME: currently unreliable in unit-tests
if not os.getenv "LVIM_TEST_ENV" then
vim.fn.mkdir(vim.fn.stdpath "cache", "p")
require("impatient").setup {
path = vim.fn.stdpath "cache" .. "/lvim_cache",
enable_profiling = true,
@ -69,12 +72,8 @@ function M:init()
}
require("plugin-loader"):init {
cache_path = self.cache_path,
runtime_dir = self.runtime_dir,
config_dir = self.config_dir,
install_path = join_paths(self.runtime_dir, "site", "pack", "packer", "start", "packer.nvim"),
package_root = join_paths(self.runtime_dir, "site", "pack"),
compile_path = join_paths(self.config_dir, "plugin", "packer_compiled.lua"),
package_root = self.pack_dir,
install_path = self.packer_install_dir,
}
return self