SmiteshP / nvim-navbuddy

A simple popup display that provides breadcrumbs feature using LSP server
Apache License 2.0
770 stars 30 forks source link

Disable operator pending mappings #41

Closed sassanh closed 1 year ago

sassanh commented 1 year ago

Thanks for this handy plugin!

Currently when I press c to comment a piece of code, it happens after some delay, because Neovim waits to see if I hit any other key after c as it goes into operator pending mode (c is the operator).

I have seen some plugins like Mason, Lazy, Packer, etc somehow disable operator pending keymaps or somehow put more priority for their own plugin (I think Lazy directly listens to key events).

It would be nice if we could have something similar for navbuddy.

SmiteshP commented 1 year ago

Why does it do into operator pending mode when navbuddy is already remapping the key 🤔 Will have to look into this.

rcsalomao commented 1 year ago

First I would like to thank you for this plugin! It's really good.

I believe what's happening is that even if you are mapping the key (In this case locally), it might conflict with any other global keybinding. I too am experiencing the same behaviour as @sassanh with the comment keybind. I made some tests and the keybinding moment is in display.lua file line 238 correct? I included on the :map(...) function the option { nowait=true } on it and it seems to have fixed and produce the desired behaviour. I just made a PR (#54 ) with the fix.