diff options
| author | Fabian David Schmidt <39233597+fdschmidt93@users.noreply.github.com> | 2022-07-19 22:43:31 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-19 21:43:31 +0200 |
| commit | 8c563017200bebd76153feb1046ecdf2db26c9d4 (patch) | |
| tree | 86b8083d605b5f3e005823ab20e21671b1005cbc /lua | |
| parent | 6bddc38c25af7b50f99cb0c035248d7272971810 (diff) | |
fix(which_key): only get telescope mappings (#2090)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/actions/utils.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lua/telescope/actions/utils.lua b/lua/telescope/actions/utils.lua index 749b79b..8018d64 100644 --- a/lua/telescope/actions/utils.lua +++ b/lua/telescope/actions/utils.lua @@ -96,8 +96,11 @@ function utils.get_registered_mappings(prompt_bufnr) for _, mode in ipairs { "n", "i" } do local mode_mappings = vim.api.nvim_buf_get_keymap(prompt_bufnr, mode) for _, mapping in ipairs(mode_mappings) do - local funcid = findnth(mapping.rhs, 2) - table.insert(ret, { mode = mode, keybind = mapping.lhs, func = __TelescopeKeymapStore[prompt_bufnr][funcid] }) + -- ensure only telescope mappings + if mapping.rhs and string.find(mapping.rhs, [[require%('telescope.mappings'%).execute_keymap]]) then + local funcid = findnth(mapping.rhs, 2) + table.insert(ret, { mode = mode, keybind = mapping.lhs, func = __TelescopeKeymapStore[prompt_bufnr][funcid] }) + end end end return ret |
