-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(interactive): use unique augroup for
live_colors()
- Loading branch information
Showing
2 changed files
with
20 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
---@param force? boolean | ||
local function reload(force) | ||
---Reloads github-theme Lua modules, skipping those which don't typically need to be | ||
---reloaded. Does not clear config unless `force` is true. | ||
---@param force? boolean reload ALL github-theme Lua modules (also clears config) | ||
return function(force) | ||
local pat = vim.regex([==[\.config\|\.deprecation\|\.override\|\.interactive]==]) | ||
|
||
for name, _ in pairs(_G.package.loaded) do | ||
if name:find('^github%-theme') then | ||
if | ||
force | ||
or ( | ||
not name:find('config') | ||
and not name:find('deprecation') | ||
and not name:find('override') | ||
) | ||
then | ||
_G.package.loaded[name] = nil | ||
end | ||
if name:find('^github%-theme') and (force or not pat:match_str(name)) then | ||
_G.package.loaded[name] = nil | ||
end | ||
end | ||
end | ||
|
||
return setmetatable({}, { | ||
__call = function(_, ...) | ||
reload(...) | ||
end, | ||
}) |