summaryrefslogtreecommitdiff
path: root/lua/lvim
diff options
context:
space:
mode:
authoropalmay <[email protected]>2023-02-24 17:07:55 +0200
committerGitHub <[email protected]>2023-02-24 17:07:55 +0200
commit2b1af90a97b8140de12a6d540c6bb8f5b615b0e6 (patch)
tree65019d10e18dcd8d30875de61d08ce248fccd662 /lua/lvim
parentd682ae0657a287be05e167ca367de4121ae666b2 (diff)
fix: lazy cache (#3892)
* fix: lazy cache * refactor: add pcall
Diffstat (limited to 'lua/lvim')
-rw-r--r--lua/lvim/plugin-loader.lua13
-rw-r--r--lua/lvim/utils/hooks.lua1
2 files changed, 1 insertions, 13 deletions
diff --git a/lua/lvim/plugin-loader.lua b/lua/lvim/plugin-loader.lua
index 5a3a94de..088b48a8 100644
--- a/lua/lvim/plugin-loader.lua
+++ b/lua/lvim/plugin-loader.lua
@@ -48,23 +48,12 @@ function plugin_loader.init(opts)
vim.opt.runtimepath:append(join_paths(plugins_dir, "*"))
pcall(function()
- -- set a custom path for lazy's cache and enable it
+ -- set a custom path for lazy's cache
local lazy_cache = require "lazy.core.cache"
lazy_cache.path = join_paths(get_cache_dir(), "lazy", "luac")
- lazy_cache.enable()
end)
end
-function plugin_loader.reset_cache()
- -- TODO(kylo252): is this really necessary anymore?
- local lazy_cache = require "lazy.core.cache"
- local cache_path = lazy_cache.path
- if utils.is_directory(cache_path) then
- vim.fn.delete(cache_path, "rf")
- vim.fn.mkdir(cache_path, "p")
- end
-end
-
function plugin_loader.reload(spec)
local Config = require "lazy.core.config"
local lazy = require "lazy"
diff --git a/lua/lvim/utils/hooks.lua b/lua/lvim/utils/hooks.lua
index af9ca99a..9f74005c 100644
--- a/lua/lvim/utils/hooks.lua
+++ b/lua/lvim/utils/hooks.lua
@@ -27,7 +27,6 @@ end
---It also forces regenerating any template ftplugin files
---Tip: Useful for clearing any outdated settings
function M.reset_cache()
- plugin_loader.reset_cache()
local lvim_modules = {}
for module, _ in pairs(package.loaded) do
if module:match "lvim.core" or module:match "lvim.lsp" then