The package dap is set to be loaded lazily, but loading is triggered by lualine, but my debugger isn't running at this moment and I don't want to load the package. Is there a way to check dap is loaded and not to trigger loading by require?
Describe the solution you'd like
A function that allows to check is package loaded or not.
So the condition in lualine will be something like that:
cond = function()
if not require("lazy").is_loaded("dap") then
return false
end
local session = require("dap").session()
return session ~= nil
end,
Describe alternatives you've considered
Search in code and found private API package._.loaded.
Did you check the docs?
Is your feature request related to a problem? Please describe.
I have a statusline (
lualine
) that has a componentdap
(https://github.com/mfussenegger/nvim-dap) status:The package
dap
is set to be loaded lazily, but loading is triggered bylualine
, but my debugger isn't running at this moment and I don't want to load the package. Is there a way to checkdap
is loaded and not to trigger loading byrequire
?Describe the solution you'd like
A function that allows to check is package loaded or not.
So the condition in lualine will be something like that:
Describe alternatives you've considered
Search in code and found private API
package._.loaded
.Additional context
No response