generated from mrcjkb/nvim-lua-nix-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
46 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
---A handler for plugins that have `lazy` set to true without any other lazy-loading mechanisms configured. | ||
---@class lz.n.LazyHandler: lz.n.Handler | ||
|
||
---@type lz.n.handler.State | ||
local state = require("lz.n.handler.state").new() | ||
|
||
local M = { | ||
spec_field = "lazy", | ||
} | ||
|
||
---@param name string | ||
---@return lz.n.Plugin? | ||
function M.lookup(name) | ||
return state.lookup_plugin(name) | ||
end | ||
|
||
---@param name string | ||
function M.del(name) | ||
state.del(name, function(cmd) | ||
pcall(vim.api.nvim_del_user_command, cmd) | ||
end) | ||
end | ||
|
||
---@param plugin lz.n.Plugin | ||
function M.add(plugin) | ||
if not plugin.lazy then | ||
return | ||
end | ||
state.insert(plugin) | ||
end | ||
|
||
return M |
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