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

[Bug]: "Resolve" duplicate keymappings e.g. when there are buffer-local keymaps that override global ones #318

Open
1 task done
mrjones2014 opened this issue Mar 14, 2023 · 0 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mrjones2014
Copy link
Owner

Similar Issues

  • Before filing, I have searched for similar issues.

Neovim Version

NVIM v0.8.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.8.2/share/nvim"

Run :checkhealth for more info

Expected Behavior

For example, when you have the following keymaps:

{ '<leader>t', description = "Something" },

{ '<leader>t' description = "Something else in buffer 1", opts = { buffer = 1 } },

When you trigger the finder from buffer 1, only the second keymap there should appear, because it is the "resolved" or "active" keymap for the keys <leader>t in that buffer. Once #317 is merged we will need to consider the filters as well when resolving keymaps.

Actual Behavior

Both keymaps are shown.

Minimal Configuration to Reproduce

Run the following code in the :LegendaryScratch buffer (by running :LegendaryEvalBuf), then trigger the finder from the same buffer:

require('legendary').keymaps({
  { '<leader>t', description = "This shouldn't show" },
  { '<leader>t', description = "This one is more specific and should show", opts = { buffer = 0 } },
})

Output from :LegendaryLog

:LegendaryLog output (click to expand)

Additional Details and/or Screenshots

No response

@mrjones2014 mrjones2014 added the bug Something isn't working label Mar 14, 2023
@mrjones2014 mrjones2014 self-assigned this Mar 14, 2023
@mrjones2014 mrjones2014 added the help wanted Extra attention is needed label Mar 14, 2023
@mrjones2014 mrjones2014 pinned this issue Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant