mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-14 01:50:27 +00:00
fix: dedupe prepend
This commit is contained in:
parent
734d10bc6d
commit
65d652dccd
@ -44,7 +44,11 @@ end
|
||||
---@return HarpoonList
|
||||
function HarpoonList:prepend(item)
|
||||
item = item or self.config.add()
|
||||
table.insert(self.items, 1, item)
|
||||
local index = index_of(self.config, self.items, item)
|
||||
if index == -1 then
|
||||
table.insert(self.items, 1, item)
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user