Skip to content

Commit 6b74256

Browse files
A-Lamiamehalter
authored andcommitted
feat(util): add function to reload modules
1 parent faccafe commit 6b74256

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lua/astrotheme/lib/util.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ function M.reload(opts, theme)
77
vim.g.colors_name = theme
88
end
99

10+
function M.reload_module(module, bool)
11+
bool = bool or false
12+
if bool then package.loaded[module] = nil end
13+
return require(module)
14+
end
15+
1016
function M.get_plugin_list(opts)
1117
local lazy_avail, lazy_config = pcall(require, "lazy.core.config")
1218
local installed_plugins = lazy_avail and lazy_config.plugins or packer_plugins

0 commit comments

Comments
 (0)