[Bugfix] Load user's autocmd custom_groups (#1393)

* Require core.autocmds before sourcing user config

* Define augroups after sourcing user config
This commit is contained in:
chaeing 2021-08-25 23:40:25 -07:00 committed by GitHub
parent 00b895d9e9
commit a83fffdc80
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -21,9 +21,6 @@ local config = require "config"
config:init()
config:load()
local autocmds = require "core.autocmds"
autocmds.define_augroups(lvim.autocommands)
local plugins = require "plugins"
local plugin_loader = require("plugin-loader").init()
plugin_loader:load { plugins, lvim.plugins }

View file

@ -27,6 +27,8 @@ end
--- Override the configuration with a user provided one
-- @param config_path The path to the configuration overrides
function M:load(config_path)
local autocmds = require "core.autocmds"
config_path = config_path or self.path
local ok, err = pcall(vim.cmd, "luafile " .. config_path)
if not ok then
@ -37,6 +39,8 @@ function M:load(config_path)
self.path = config_path
autocmds.define_augroups(lvim.autocommands)
local settings = require "config.settings"
settings.load_commands()
end