mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-14 01:50:27 +00:00
feat: introduce reorder event
This commit is contained in:
parent
70703d6ce1
commit
90dc9599e3
@ -147,6 +147,12 @@ function HarpoonList:resolve_displayed(displayed)
|
||||
)
|
||||
new_list[i] = self.config.create_list_item(self.config, v)
|
||||
else
|
||||
if index ~= i then
|
||||
Listeners.listeners:emit(
|
||||
Listeners.event_names.REORDER,
|
||||
{ list = self, item = self.items[index], idx = i }
|
||||
)
|
||||
end
|
||||
local index_in_new_list =
|
||||
index_of(new_list, self.items[index], self.config)
|
||||
if index_in_new_list == -1 then
|
||||
|
@ -52,5 +52,6 @@ return {
|
||||
ADD = "ADD",
|
||||
SELECT = "SELECT",
|
||||
REMOVE = "REMOVE",
|
||||
REORDER = "REORDER",
|
||||
},
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user