mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-13 17:40:25 +00:00
Merge pull request #425 from willothy/list-read-evt
feat: add `LIST_READ` event
This commit is contained in:
commit
9ef3cb0794
@ -1,5 +1,3 @@
|
||||
--- TODO: Rename this... its an odd name "listeners"
|
||||
|
||||
---@class HarpoonExtensions
|
||||
---@field listeners HarpoonExtension[]
|
||||
local HarpoonExtensions = {}
|
||||
@ -12,6 +10,7 @@ local HarpoonExtensions = {}
|
||||
---@field UI_CREATE? fun(...): nil
|
||||
---@field SETUP_CALLED? fun(...): nil
|
||||
---@field LIST_CREATED? fun(...): nil
|
||||
---@field LIST_READ? fun(...): nil
|
||||
---@field NAVIGATE? fun(...): nil
|
||||
|
||||
HarpoonExtensions.__index = HarpoonExtensions
|
||||
@ -64,5 +63,6 @@ return {
|
||||
SETUP_CALLED = "SETUP_CALLED",
|
||||
LIST_CREATED = "LIST_CREATED",
|
||||
NAVIGATE = "NAVIGATE",
|
||||
LIST_READ = "LIST_READ",
|
||||
},
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ function Harpoon:list(name)
|
||||
self.data.seen[key] = {}
|
||||
end
|
||||
self.data.seen[key][name] = true
|
||||
self._extensions:emit(Extensions.event_names.LIST_READ, existing_list)
|
||||
return existing_list
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user