Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroBinotto committed Aug 16, 2024
1 parent 0378a6c commit 2ee0956
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lua/harpoon/list.lua
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ end
--- @return string[]
function HarpoonList:encode()
local out = {}
for _, v in ipairs(self.items) do
table.insert(out, self.config.encode(v))
for k, v in pairs(self.items) do
out[k] = self.config.encode(v)
end

return out
Expand All @@ -357,9 +357,8 @@ end
--- @param items string[]
function HarpoonList.decode(list_config, name, items)
local list_items = {}

for _, item in ipairs(items) do
table.insert(list_items, list_config.decode(item))
for k, item in pairs(items) do
list_items[k] = item ~= vim.NIL and list_config.decode(item) or nil
end

return HarpoonList:new(list_config, name, list_items)
Expand Down

0 comments on commit 2ee0956

Please sign in to comment.