You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
my-nvim-lua/lua/sp4ke/utils.lua

23 lines
496 B
Lua

local M = {}
M["unload_lua_ns"] = function (prefix)
local prefix_with_dot = prefix .. '.'
for key, _ in pairs(package.loaded) do
if key == prefix or key:sub(1, #prefix_with_dot) == prefix_with_dot then
print("removing: ", key)
package.loaded[key] = nil
end
end
end
-- M.unload_lua_ns("core")
M.list_loaded_modules = function ()
local loaded = {}
for k, _ in pairs(package.loaded) do
loaded[#loaded + 1] = k
end
vim.ui.select(loaded, {}, nil)
end
return M