otavioschwanck / arrow.nvim

Bookmark your files, separated by project, and quickly navigate through them.
Other
341 stars 16 forks source link

strange leader_key behaviour when updating #47

Closed JanikvA closed 3 months ago

JanikvA commented 3 months ago

Hi!

first of all big thank you because I really love this Plugin, and it is much better than Harpoon imo.

Just a small bug that I have noticed with the following config

return { "otavioschwanck/arrow.nvim", opts = { show_icons = true, leader_key = 'm', } }

If I press 'm' in a buffer I get the menu for the 'per buffer marks' but when I have the following config

return { "otavioschwanck/arrow.nvim", opts = { show_icons = true, leader_key = 'm', buffer_leader_key = 'M', } }

And I press the 'm' key now I get the global menu. I think this behaviour is very confusing and annoyed me quite a bit when I updated the plugin because of course I was using the first version and when pressing my usual hot keys I get the (at first) confusing per buffer marks menu.

But now that I know what it is I think this new menu is a very cool addition

otavioschwanck commented 3 months ago

Hi!

first of all big thank you because I really love this Plugin, and it is much better than Harpoon imo.

Just a small bug that I have noticed with the following config

return { "otavioschwanck/arrow.nvim", opts = { show_icons = true, leader_key = 'm', } }

If I press 'm' in a buffer I get the menu for the 'per buffer marks' but when I have the following config

return { "otavioschwanck/arrow.nvim", opts = { show_icons = true, leader_key = 'm', buffer_leader_key = 'M', } }

And I press the 'm' key now I get the global menu. I think this behaviour is very confusing and annoyed me quite a bit when I updated the plugin because of course I was using the first version and when pressing my usual hot keys I get the (at first) confusing per buffer marks menu.

But now that I know what it is I think this new menu is a very cool addition

it was a bug (was setting the buffer_leader_key automatically). Fixed it. Thanks for the issue!

mateusjdev commented 3 months ago

The commit https://github.com/otavioschwanck/arrow.nvim/commit/c6bbbb5d0be7ce65cdfcdf923119e5013691c474 actualy cause a new problem, in ui.lua file, the vim.keymap.set() expects a value from getState, if the user has not defined a keymap for buffer_leader_key (which happened to me as I updated the plugin and did not add it to opts{}) it will trown a error:

https://github.com/otavioschwanck/arrow.nvim/blob/c6bbbb5d0be7ce65cdfcdf923119e5013691c474/lua/arrow/ui.lua#L448

E5108: Error executing lua: vim/keymap.lua:0: lhs: expected string, got nil
stack traceback:
        [C]: in function 'error'
        vim/shared.lua: in function 'validate'
        vim/keymap.lua: in function 'set'
        ...sjdev/.local/share/nvim/lazy/arrow.nvim/lua/arrow/ui.lua:448: in function <...sjdev/.local/share/nvim/lazy/arrow.nvim/lua/arrow/ui.lua:415>