diff options
author | kylo252 <[email protected]> | 2022-10-17 17:29:15 +0200 |
---|---|---|
committer | kylo252 <[email protected]> | 2022-10-17 17:29:15 +0200 |
commit | 4ef07315003f723bb8e97d5a91b2bde3773ec1b8 (patch) | |
tree | e9889a492f76e3f9573228343aaba647dfd48136 /lua/lvim/bootstrap.lua | |
parent | e4a5fe97abe500bbbe78fb137d57a59f558da05a (diff) | |
parent | 6f6cbc394d2a7e64964b6067a2f42d2e6a07824e (diff) |
Merge remote-tracking branch 'origin/rolling'
Diffstat (limited to 'lua/lvim/bootstrap.lua')
-rw-r--r-- | lua/lvim/bootstrap.lua | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/lua/lvim/bootstrap.lua b/lua/lvim/bootstrap.lua index f637c144..5d980498 100644 --- a/lua/lvim/bootstrap.lua +++ b/lua/lvim/bootstrap.lua @@ -1,7 +1,7 @@ local M = {} -if vim.fn.has "nvim-0.7" ~= 1 then - vim.notify("Please upgrade your Neovim base installation. Lunarvim requires v0.7+", vim.log.levels.WARN) +if vim.fn.has "nvim-0.8" ~= 1 then + vim.notify("Please upgrade your Neovim base installation. Lunarvim requires v0.8+", vim.log.levels.WARN) vim.wait(5000, function() return false end) @@ -19,15 +19,9 @@ function _G.join_paths(...) return result end ----Require a module in protected mode without relying on its cached value ----@param module string ----@return any -function _G.require_clean(module) - package.loaded[module] = nil - _G[module] = nil - local _, requested = pcall(require, module) - return requested -end +_G.require_clean = require("lvim.utils.modules").require_clean +_G.require_safe = require("lvim.utils.modules").require_safe +_G.reload = require("lvim.utils.modules").reload ---Get the full path to `$LUNARVIM_RUNTIME_DIR` ---@return string @@ -70,7 +64,7 @@ function M:init(base_dir) 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") - ---@meta overridden to use LUNARVIM_CACHE_DIR instead, since a lot of plugins call this function interally + ---@meta overridden to use LUNARVIM_CACHE_DIR instead, since a lot of plugins call this function internally ---NOTE: changes to "data" are currently unstable, see #2507 vim.fn.stdpath = function(what) if what == "cache" then @@ -90,6 +84,7 @@ function M:init(base_dir) vim.opt.rtp:remove(join_paths(vim.call("stdpath", "data"), "site")) vim.opt.rtp:remove(join_paths(vim.call("stdpath", "data"), "site", "after")) vim.opt.rtp:prepend(join_paths(self.runtime_dir, "site")) + vim.opt.rtp:append(join_paths(self.runtime_dir, "lvim", "after")) vim.opt.rtp:append(join_paths(self.runtime_dir, "site", "after")) vim.opt.rtp:remove(vim.call("stdpath", "config")) @@ -120,10 +115,10 @@ end ---Update LunarVim ---pulls the latest changes from github and, resets the startup cache function M:update() - require_clean("lvim.utils.hooks").run_pre_update() - local ret = require_clean("lvim.utils.git").update_base_lvim() + reload("lvim.utils.hooks").run_pre_update() + local ret = reload("lvim.utils.git").update_base_lvim() if ret then - require_clean("lvim.utils.hooks").run_post_update() + reload("lvim.utils.hooks").run_post_update() end end |