Skip to content
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

Deleting marks from middle of the list breaks telescope extension #588

Open
waduhek opened this issue May 9, 2024 · 0 comments
Open

Deleting marks from middle of the list breaks telescope extension #588

waduhek opened this issue May 9, 2024 · 0 comments

Comments

@waduhek
Copy link

waduhek commented May 9, 2024

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

  1. Add 3 or more marks to the harpoon list.
  2. Delete any mark from the middle of the list using the telescope finder. Any mark apart from the last mark should do.
  3. 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" } }

Neovim Version

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1713773202

Minimal Config

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({
        "git",
        "clone",
        "--filter=blob:none",
        "https://github.com/folke/lazy.nvim.git",
        "--branch=stable",
        lazypath,
    })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
    {
        "nvim-telescope/telescope.nvim",
        tag = "0.1.5",
        dependencies = {
            "nvim-lua/plenary.nvim",
        },
    },
    {
        "ThePrimeagen/harpoon",
        branch = "harpoon2",
        dependencies = {
            "nvim-lua/plenary.nvim",
            "nvim-telescope/telescope.nvim",
        },
        config = function ()
            require("telescope").load_extension("harpoon")
        end
    },
})

local harpoon = require("harpoon")
local telescope = require("telescope")

harpoon:setup()

vim.keymap.set(
    "n",
    "<leader>a",
    function()
        harpoon:list():add()
    end
)

vim.keymap.set("n", "<C-q>", telescope.extensions.harpoon.marks)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant