diff options
author | LostNeophyte <[email protected]> | 2023-02-25 12:24:12 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2023-02-25 12:24:12 +0100 |
commit | a7e7f28639a70ac56d77867c283c3666cae8ab4d (patch) | |
tree | b514e241c92ad517cb819419c370243743334399 | |
parent | 5951c431e6fa76c0bbc60ba253e06bec2c3b006c (diff) |
fix(config-loader): defer invalid configuration warning (#3869)
-rw-r--r-- | lua/lvim/config/init.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lua/lvim/config/init.lua b/lua/lvim/config/init.lua index 9f4bb45e..90c17888 100644 --- a/lua/lvim/config/init.lua +++ b/lua/lvim/config/init.lua @@ -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") |