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

strange leader_key behaviour when updating #47

Closed
JanikvA opened this issue Apr 17, 2024 · 2 comments
Closed

strange leader_key behaviour when updating #47

JanikvA opened this issue Apr 17, 2024 · 2 comments

Comments

@JanikvA
Copy link

JanikvA commented Apr 17, 2024

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
Copy link
Owner

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
Copy link

The commit c6bbbb5 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:

vim.keymap.set("n", config.getState("buffer_leader_key"), function()

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>

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

3 participants