mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-13 17:40:25 +00:00
fix: moved extra list decode to config decode
This commit is contained in:
parent
be7470853d
commit
663e9aad24
@ -77,7 +77,12 @@ function M.get_default_config()
|
||||
---@param str string
|
||||
---@return HarpoonListItem
|
||||
decode = function(str)
|
||||
return vim.json.decode(str)
|
||||
local decodedItem = vim.json.decode(str)
|
||||
|
||||
-- NOTE: prevents this absolute path sometimes bug by forcing
|
||||
-- everything to be absolute path always
|
||||
decodedItem.value = vim.loop.fs_realpath(decodedItem.value)
|
||||
return decodedItem
|
||||
end,
|
||||
|
||||
---@param list_item HarpoonListItem
|
||||
|
@ -360,11 +360,6 @@ function HarpoonList.decode(list_config, name, items)
|
||||
local list_items = {}
|
||||
|
||||
for _, item in ipairs(items) do
|
||||
-- this is here to prevent a breaking change by converting saved relative paths to absolute. remove after some time
|
||||
local decodedItem = vim.json.decode(item)
|
||||
decodedItem.value = vim.loop.fs_realpath(decodedItem.value)
|
||||
item = vim.json.encode(decodedItem)
|
||||
|
||||
table.insert(list_items, list_config.decode(item))
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user