mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-14 01:50:27 +00:00
Merge pull request #395 from willothy/event-moved
feat: introduce move event
This commit is contained in:
commit
0243fdc13f
@ -149,6 +149,12 @@ function HarpoonList:resolve_displayed(displayed)
|
|||||||
{ list = self, item = new_list[i], idx = i }
|
{ list = self, item = new_list[i], idx = i }
|
||||||
)
|
)
|
||||||
else
|
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 =
|
local index_in_new_list =
|
||||||
index_of(new_list, self.items[index], self.config)
|
index_of(new_list, self.items[index], self.config)
|
||||||
if index_in_new_list == -1 then
|
if index_in_new_list == -1 then
|
||||||
|
@ -52,5 +52,6 @@ return {
|
|||||||
ADD = "ADD",
|
ADD = "ADD",
|
||||||
SELECT = "SELECT",
|
SELECT = "SELECT",
|
||||||
REMOVE = "REMOVE",
|
REMOVE = "REMOVE",
|
||||||
|
REORDER = "REORDER",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user