mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 10:35:08 +02:00
fix(config-loader): defer invalid configuration warning (#3869)
This commit is contained in:
parent
5951c431e6
commit
a7e7f28639
1 changed files with 8 additions and 4 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue