-
-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error in deleting marks in telescope #596
Comments
related to: #602 |
I am using my own local opts = { noremap = true, silent = true }
local harpoon = require("harpoon")
local list = harpoon:list()
function Remove(item)
item = item or list.config.create_list_item(list.config)
print("Hello")
local Extensions = require("harpoon.extensions")
local Logger = require("harpoon.logger")
local items = list.items
if item ~= nil then
for i = 1, list._length do
local v = items[i]
print(vim.inspect(v))
if list.config.equals(v, item) then
-- this clears list somehow
-- items[i] = nil
table.remove(items, i)
list._length = list._length - 1
Logger:log("HarpoonList:remove", { item = item, index = i })
Extensions.extensions:emit(
Extensions.event_names.REMOVE,
{ list = list, item = item, idx = i }
)
break
end
end
end
end |
Thank you for your reply! |
Hey @PhoenixPtt I just added a telescope extension to my Harpoon extension harpoonEx, which should solve the problems you are having. |
Hey @mike-jl local harpoon = require("harpoon")
vim.keymap.set("n", "<leader>hp", function()
harpoon:list():add()
end)
local harpoonEx = require("harpoonEx")
-- load extension
harpoon:extend(harpoonEx.extend())
-- register keys
-- Toggle previous & next buffers stored within Harpoon list
vim.keymap.set("n", "<S-Tab>", function()
harpoonEx.next_harpoon(harpoon:list(), true)
end, { desc = "Switch to previous buffer in Harpoon List" })
vim.keymap.set("n", "<Tab>", function()
harpoonEx.next_harpoon(harpoon:list(), false)
end, { desc = "Switch to next buffer in Harpoon List" })
vim.keymap.set("n", "<M-d>", function()
harpoonEx.delete(harpoon:list())
end, { desc = "Add current filte to Harpoon List" })
-- the rest of your config function
vim.keymap.set("n", "<M-e>", function()
require("telescope").extensions.harpoonEx.harpoonEx({
-- Optional: modify mappings, default mappings:
attach_mappings = function(_, map)
local actions = require("telescope.actions")
-- map({ "i", "n" }, "<M-d>", actions.delete_mark)
map( "n", "dm", actions.delete_mark)
--[[ map({ "i", "n" }, "<M-k>", actions.move_mark_up)
map({ "i", "n" }, "<M-j>", actions.move_mark_down) ]]
map({ "i", "n" }, "<M-j>", actions.select_default)
end,
})
return true
end, { desc = "Open harpoon window" })
end,
|
@PhoenixPtt I'm sorry, i misread the telescope documentation and didn't implement the configuration correctly. |
@mike-jl, I updated harpoonEx to the latest version, but there's still bug there, big bug. |
I forgot one line in the readme... At the end of the end of the attach_mappings function, add return true: |
The text was updated successfully, but these errors were encountered: