mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-11-06 01:11:07 +00:00
feat(loader): handle hyphens in file names when deactivating
## Description When deactivating plugins `vim.g.loaded_` variables are cleared based on a common pattern plugins use to use avoid multiple initializing. The current logic handles most cases, except when a lua file has a hyphen in which case it is unlikely to clear the correct variable.
This commit is contained in:
parent
e6a8824858
commit
28fb0f37de
1 changed files with 1 additions and 1 deletions
|
|
@ -238,7 +238,7 @@ function M.deactivate(plugin)
|
||||||
-- clear vim.g.loaded_ for plugins
|
-- clear vim.g.loaded_ for plugins
|
||||||
Util.ls(plugin.dir .. "/plugin", function(_, name, type)
|
Util.ls(plugin.dir .. "/plugin", function(_, name, type)
|
||||||
if type == "file" then
|
if type == "file" then
|
||||||
vim.g["loaded_" .. name:gsub("%..*", "")] = nil
|
vim.g["loaded_" .. name:gsub("%..*", ""):gsub("-", "_")] = nil
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
-- set as not loaded
|
-- set as not loaded
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue