Closed danilshvalov closed 1 year ago
Since the get_keymap
method is now being hacked, the tests do not pass. Here are two options that I see. The first is obviously to remove the falling tests. The second is to come up with something more elegant. But nothing comes to mind so far.
Great, I figured out how to fix the tests: use the original functions!
Hi! Thanks for your contribution!
I tested this PR and it does not seem to work as expected:
The filter_default_keymaps
function always returns an empty table instead of filtered. With my config, this behavior breaks neo-tree
. Also, I'm installed which-key
for testing, and it breaks showing prompt when I press <leader>
. I think, the best way to filter original mappings table - it is to see that mapping.desc
does not contain LM
(prefix of all mappings handled by langmapper).
I think wrappers for get_keymap
should not be hacked by default. Better is to just add it to the API and if users need to hack it, they can do it themselves in their config.
I checked the method with desc
and it doesn't work the way I would like. I will try to fix the filtering function. I've changed something, try again, does the above work for you?
I also made them optional. Now you need to activate them as follows:
local langmapper = require("langmapper")
langmapper.setup()
langmapper.hack_get_keymap()
With my config, this behavior breaks
neo-tree
. Also, I'm installedwhich-key
for testing, and it breaks showing prompt when I press<leader>
.
It's strange that which-key
and neo-tree
don't work for you. Everything works as expected for me. I hope the latest patches will fix the problem.
It's strange that
which-key
andneo-tree
don't work for you. Everything works as expected for me. I hope the latest patches will fix the problem.
I'll test again tonight. Not at the computer anymore.
Great, now it works! Thanks again!
Fixed #8
See https://github.com/Wansmer/langmapper.nvim/issues/8#issuecomment-1529135431