Skip to content

Commit

Permalink
fix(config-loader): defer invalid configuration warning (LunarVim#3869)
Browse files Browse the repository at this point in the history
  • Loading branch information
LostNeophyte committed Feb 25, 2023
1 parent 5951c43 commit a7e7f28
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lua/lvim/config/init.lua
Original file line number Diff line number Diff line change
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

0 comments on commit a7e7f28

Please sign in to comment.