Skip to content

API #18

API #18
Jun 21, 2024 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

I made a handler that can do this for you

Kinda quick and dirty but this works.

Say we saved it at lua/lz_n_debug

---@type table<string, string>
local states = {}

local M = {
  ---@type lz.n.Handler
  handler = {
	-- normally we would use this to allow the user to pass us a spec item
	-- but here its just a name that we are going to set the value of ourselves
	spec_field = "is_loaded",
	-- del is called whenever require('lz.n').trigger_load is called, once for every plugin spec
	---@param plugin lz.n.Plugin
	del = function (plugin)
	  states[plugin.name] = plugin.name
	end,
	-- add is called whenever require('lz.n').load parses a spec
        -- we could use it to store the plugins as th…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies

This comment was marked as disruptive content.

@pseudoparenchymatous
Comment options

@BirdeeHub

This comment was marked as disruptive content.

@BirdeeHub

This comment was marked as disruptive content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants