Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
* upstream/master:
  fix(config-loader): defer invalid configuration warning (LunarVim#3869)
  chore: replace deprecated MDI Orbit icon (LunarVim#3880)
  fix: lazy cache (LunarVim#3892)
  • Loading branch information
hexsailor committed Feb 27, 2023
2 parents 868ef87 + a7e7f28 commit 732ac5d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
12 changes: 8 additions & 4 deletions lua/lvim/config/init.lua
Expand Up @@ -51,11 +51,15 @@ function M:load(config_path)
local ok, err = pcall(dofile, config_path)
if not ok then
if utils.is_file(user_config_file) then
Log:warn("Invalid configuration: " .. err)
vim.schedule(function()
Log:warn("Invalid configuration: " .. err)
end)
else
vim.notify_once(
string.format("User-configuration not found. Creating an example configuration in %s", config_path)
)
vim.schedule(function()
vim.notify_once(
string.format("User-configuration not found. Creating an example configuration in %s", config_path)
)
end)
local config_name = vim.loop.os_uname().version:match "Windows" and "config_win" or "config"
local example_config = join_paths(get_lvim_base_dir(), "utils", "installer", config_name .. ".example.lua")
vim.fn.mkdir(user_config_dir, "p")
Expand Down
2 changes: 1 addition & 1 deletion lua/lvim/icons.lua
Expand Up @@ -118,7 +118,7 @@ return {
SignOut = "",
Tab = "",
Table = "",
Target = "",
Target = "󰀘",
Telescope = "",
Text = "",
Tree = "",
Expand Down
13 changes: 1 addition & 12 deletions lua/lvim/plugin-loader.lua
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion lua/lvim/utils/hooks.lua
Expand Up @@ -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
Expand Down

0 comments on commit 732ac5d

Please sign in to comment.