Instead of keeping relative path in listItem.value and converting it to absolute every time you need it, this PR keeps absolute path in listItem.value and converts is to relative path only once when you need to display it in the menu.
Basically stole the idea from this TODO:
https://github.com/ThePrimeagen/harpoon/blob/da326d0438ac68dee9b6b62a734be940a8bd8405/lua/harpoon/config.lua#L193-L197
but instead of storing bufname it stores an absolute path, which will always make vim.fn.bufnr(path) return the right buffer number regardless of how the bufname is saved as.
This PR fixes issues #563 and #566, that are both caused by comparing relative paths with absolute ones. And any future issues that are caused by forgetting to convert to an absolute path(or thinking its unnecessary).
Also fixes an undocumented wierd bug that sometimes makes listItem.value be an absolute path even when the file it points to is inside the current working directory
Instead of keeping relative path in
listItem.value
and converting it to absolute every time you need it, this PR keeps absolute path inlistItem.value
and converts is to relative path only once when you need to display it in the menu. Basically stole the idea from this TODO: https://github.com/ThePrimeagen/harpoon/blob/da326d0438ac68dee9b6b62a734be940a8bd8405/lua/harpoon/config.lua#L193-L197 but instead of storing bufname it stores an absolute path, which will always makevim.fn.bufnr(path)
return the right buffer number regardless of how the bufname is saved as. This PR fixes issues #563 and #566, that are both caused by comparing relative paths with absolute ones. And any future issues that are caused by forgetting to convert to an absolute path(or thinking its unnecessary). Also fixes an undocumented wierd bug that sometimes makeslistItem.value
be an absolute path even when the file it points to is inside the current working directory