summaryrefslogtreecommitdiff
path: root/lua/telescope/actions/utils.lua
diff options
context:
space:
mode:
authorFabian David Schmidt <39233597+fdschmidt93@users.noreply.github.com>2022-07-19 22:43:31 +0300
committerGitHub <noreply@github.com>2022-07-19 21:43:31 +0200
commit8c563017200bebd76153feb1046ecdf2db26c9d4 (patch)
tree86b8083d605b5f3e005823ab20e21671b1005cbc /lua/telescope/actions/utils.lua
parent6bddc38c25af7b50f99cb0c035248d7272971810 (diff)
fix(which_key): only get telescope mappings (#2090)
Diffstat (limited to 'lua/telescope/actions/utils.lua')
-rw-r--r--lua/telescope/actions/utils.lua7
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