mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat: automatically detect config module changes in or oustside Neovim and reload
This commit is contained in:
parent
fbfa790d46
commit
7b272b6ed6
6 changed files with 94 additions and 8 deletions
|
@ -33,7 +33,7 @@ M.defaults = {
|
|||
-- install missing plugins on startup. This doesn't increase startup time.
|
||||
missing = true,
|
||||
-- try to load one of the colorschemes in this list when starting an install during startup
|
||||
-- the first colorscheme that is found will be used
|
||||
-- the first colorscheme that is found will be loaded
|
||||
colorscheme = { "habamax" },
|
||||
},
|
||||
ui = {
|
||||
|
@ -100,6 +100,7 @@ function M.setup(spec, opts)
|
|||
callback = function()
|
||||
require("lazy.core.cache").autosave()
|
||||
require("lazy.view").setup()
|
||||
require("lazy.manage.reloader").enable()
|
||||
end,
|
||||
})
|
||||
|
||||
|
|
|
@ -63,7 +63,9 @@ function M.trigger(groups, events, pattern)
|
|||
end
|
||||
Util.info(lines)
|
||||
end
|
||||
vim.api.nvim_exec_autocmds(autocmd.event, { group = autocmd.group, modeline = false })
|
||||
Util.try(function()
|
||||
vim.api.nvim_exec_autocmds(autocmd.event, { group = autocmd.group, modeline = false })
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -195,6 +195,8 @@ function M.spec()
|
|||
-- spec is a module
|
||||
local function _load(name)
|
||||
local modname = name and (Config.spec .. "." .. name) or Config.spec
|
||||
-- unload the module so we get a clean slate
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
package.loaded[modname] = nil
|
||||
Util.try(function()
|
||||
spec:normalize(require(modname))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue