ThePrimeagen / harpoon

MIT License
6.23k stars 347 forks source link

[harpoon2] Select shows absolute path instead of relative path #610

Open juru1234 opened 1 week ago

juru1234 commented 1 week ago

Hi,

I'm using harpoon2. When I start neovim and directly jump to the following buffers using:

vim.keymap.set("n", "<leader>1", function() harpoon:list():select(1) end) vim.keymap.set("n", "<leader>2", function() harpoon:list():select(2) end)

my statusline always shows an absolute path for the second one instead of a relative one.

If I start neovim and cycle through my buffers using

vim.keymap.set("n", "hn", function() harpoon:list():next() end)

all files are shown correctly with their relative paths. Now I can also use select and the relative paths are still shown correctly.

juru1234 commented 1 week ago

Ok, I found out this doesn't happen when using lualine with relative paths enabled. Only when defining my own statusline with

local statusline = {
    ' %f',
    '%r',
    '%m',
    '%=',
    '%{&filetype}',
    ' %2p%%',
    ' %3l:%-2c '
}
vim.o.statusline = table.concat(statusline, '')

Seems to be a problem with the %f