summaryrefslogtreecommitdiff
path: root/lua/telescope/mappings.lua
diff options
context:
space:
mode:
authorSimon Hauser <Simon-Hauser@outlook.de>2021-11-23 23:51:25 +0100
committerGitHub <noreply@github.com>2021-11-23 23:51:25 +0100
commit1c57cc6140644695f0d9bd71b63de45feeca6ae7 (patch)
treeca9ddaa4839dcd6c485aa1c249b5a14c79f0d068 /lua/telescope/mappings.lua
parent7695d224c81e4ceeb3100d759c296814183ccfae (diff)
Revert "fix: action mt so we can again concat actions from two different tables (#1143)" (#1486)
This reverts commit 6daf35c88c07dd4b220468968a742cda04889cd3.
Diffstat (limited to 'lua/telescope/mappings.lua')
-rw-r--r--lua/telescope/mappings.lua10
1 files changed, 4 insertions, 6 deletions
diff --git a/lua/telescope/mappings.lua b/lua/telescope/mappings.lua
index b78923f..27e5d07 100644
--- a/lua/telescope/mappings.lua
+++ b/lua/telescope/mappings.lua
@@ -221,6 +221,10 @@ mappings.apply_keymap = function(prompt_bufnr, attach_mappings, buffer_keymap)
end
end
end
+
+ vim.cmd(
+ string.format([[autocmd BufDelete %s :lua require('telescope.mappings').clear(%s)]], prompt_bufnr, prompt_bufnr)
+ )
end
mappings.execute_keymap = function(prompt_bufnr, keymap_identifier)
@@ -233,12 +237,6 @@ mappings.execute_keymap = function(prompt_bufnr, keymap_identifier)
end
mappings.clear = function(prompt_bufnr)
- require("telescope.actions.mt").clear_all()
- -- TODO(conni2461): This seems like the better solution but it won't clear actions that were never mapped
- -- for _, v in ipairs(keymap_store[prompt_bufnr]) do
- -- pcall(v.clear)
- -- end
-
keymap_store[prompt_bufnr] = nil
end