You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After adding multiple marks and deleting one or more of them from the middle of the list, the telescope extension does not display the rest of the marks after the deleted mark.
Reproduction steps
Add 3 or more marks to the harpoon list.
Delete any mark from the middle of the list using the telescope finder. Any mark apart from the last mark should do.
Check the list of marks again in the telescope finder.
Log file
config_default#create_list_item lua/harpoon/ui.lua
HarpoonList:add { index = -1, item = { context = { col = 0, row = 1 }, value = "lua/harpoon/ui.lua" } }
config_default#create_list_item lua/harpoon/autocmd.lua
HarpoonList:add { index = -1, item = { context = { col = 0, row = 1 }, value = "lua/harpoon/autocmd.lua" } }
config_default#create_list_item lua/harpoon/config.lua
HarpoonList:add { index = -1, item = { context = { col = 0, row = 1 }, value = "lua/harpoon/config.lua" } }
config_default#BufLeave updating position 7 lua/harpoon/config.lua { context = { col = 0, row = 1 }, value = "lua/harpoon/config.lua" } to position { 1, 0 }
HarpoonList:remove { index = 2, item = { context = { col = 0, row = 1 }, value = "lua/harpoon/autocmd.lua" } }
This could be related to #555. But since that issue doesn't mention the telescope extension I thought of creating a new issue for it.
A workaround that I've found is to open the harpoon quick menu and delete the mark from there to get telescope to show the rest of the marks. Additionally, the harpoon quick menu shows a blank line for where the mark used be.
The text was updated successfully, but these errors were encountered:
Yeah, for me, it's the same and it's because remove_at changes the structure of the table by setting the list's item to nil:
Though replacing the remove logic for table.remove, it seems it works again:
I'm currently on the harpoon2 branch at commit 0378a6c, where I have the following diff which solves my issue:
diff --git a/lua/harpoon/list.lua b/lua/harpoon/list.lua
index 897122f..b65ef88 100644
--- a/lua/harpoon/list.lua
+++ b/lua/harpoon/list.lua
@@ -208,7 +208,7 @@ function HarpoonList:remove_at(index)
"HarpoonList:removeAt",
{ item = self.items[index], index = index }
)
- self.items[index] = nil
+ table.remove(self.items, index)
if index == self._length then
self._length = determine_length(self.items, self._length)
end
Later on today, I could create a PR for it, or if anyone has the time then feel free to do it. NOTE: It should probably be checked if other places use this nil logic and see if those work as expected.
Description of the issue
After adding multiple marks and deleting one or more of them from the middle of the list, the telescope extension does not display the rest of the marks after the deleted mark.
Reproduction steps
Log file
Neovim Version
Minimal Config
Additional context
This could be related to #555. But since that issue doesn't mention the telescope extension I thought of creating a new issue for it.
A workaround that I've found is to open the harpoon quick menu and delete the mark from there to get telescope to show the rest of the marks. Additionally, the harpoon quick menu shows a blank line for where the mark used be.
The text was updated successfully, but these errors were encountered: