-
-
Notifications
You must be signed in to change notification settings - Fork 380
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
[harpoon2] when custom key is specified, persistent not working correctly #565
Comments
let me try this out and i'll see if we can get a quick fix for this seems surprising! |
same bug here This is my setup:
|
Same problem with a similar configuration (different lists based on branch). |
Problem with the_harpoon singleton. When module imported, singleton created, and using default key for data storage (vim.loop.cwd). Then when |
Having this issue as well with a similar config, hoping that #557 can be merged soon |
I have the same issue, from what I see in the thread – this does not seem to be the issue of any particular Here's my approach: (Added logging to check the sanity, and the returned key appears to be correct and repeatable for the branch) local function debug_print(...)
print(vim.inspect(...))
end
harpoon:setup({
settings = {
key = function()
debug_print("key")
local pipe = io.popen("git branch --show-current")
if pipe then
debug_print("pipe")
local c = pipe:read("*l"):match("^%s*(.-)%s*$")
debug_print(c)
pipe:close()
return c
end
return "default list"
end,
},
}) Edit: Found a workaround. No need to set local function git_branch()
debug_print("key")
local pipe = io.popen("git branch --show-current")
if pipe then
debug_print("pipe")
local c = pipe:read("*l"):match("^%s*(.-)%s*$")
debug_print(c)
pipe:close()
return c
end
return "default list"
end and use it in each keymap declaration, like this {
"<M-j>",
function()
harpoon:list(git_branch()):next()
end,
desc = "Select next",
}, |
WARNING
If this is about Harpoon1, the issue will be closed. All support and everything of harpoon1 will be frozen on
master
until 4/20 or 6/9 and then harpoon2 will become masterPlease use
harpoon2
for branchMy harpoon setup:
I add and remove file to harpoon, but when i close and open nvim again, my harpoon list is empty.
The text was updated successfully, but these errors were encountered: