summaryrefslogtreecommitdiff
path: root/lua/telescope/builtin/__internal.lua
diff options
context:
space:
mode:
authorADoyle <adoyle.h@gmail.com>2022-11-07 00:42:29 +0800
committerGitHub <noreply@github.com>2022-11-06 17:42:29 +0100
commitd541e0d6e00a0d89f21e1b0e6fe92c736ac0f83b (patch)
tree97e583b055ffb8fbdd5bdb3865a106eae20a2c3c /lua/telescope/builtin/__internal.lua
parent30826fcfb8dd8c63cb3d69e72e23b1f037170f35 (diff)
feat: the parameter "map" of attach_mappings can be list of modes to create mapping on multiple modes (#2220)
Diffstat (limited to 'lua/telescope/builtin/__internal.lua')
-rw-r--r--lua/telescope/builtin/__internal.lua17
1 files changed, 6 insertions, 11 deletions
diff --git a/lua/telescope/builtin/__internal.lua b/lua/telescope/builtin/__internal.lua
index 3684518..9b6931d 100644
--- a/lua/telescope/builtin/__internal.lua
+++ b/lua/telescope/builtin/__internal.lua
@@ -198,8 +198,7 @@ internal.pickers = function(opts)
opts["initial_mode"] = cached_pickers[selection_index].initial_mode
internal.resume(opts)
end)
- map("i", "<C-x>", actions.remove_selected_picker)
- map("n", "<C-x>", actions.remove_selected_picker)
+ map({ "i", "n" }, "<C-x>", actions.remove_selected_picker)
return true
end,
})
@@ -556,10 +555,8 @@ internal.command_history = function(opts)
sorter = conf.generic_sorter(opts),
attach_mappings = function(_, map)
- map("i", "<CR>", actions.set_command_line)
- map("n", "<CR>", actions.set_command_line)
- map("n", "<C-e>", actions.edit_command_line)
- map("i", "<C-e>", actions.edit_command_line)
+ map({ "i", "n" }, "<CR>", actions.set_command_line)
+ map({ "i", "n" }, "<C-e>", actions.edit_command_line)
-- TODO: Find a way to insert the text... it seems hard.
-- map('i', '<C-i>', actions.insert_value, { expr = true })
@@ -588,10 +585,8 @@ internal.search_history = function(opts)
sorter = conf.generic_sorter(opts),
attach_mappings = function(_, map)
- map("i", "<CR>", actions.set_search_line)
- map("n", "<CR>", actions.set_search_line)
- map("n", "<C-e>", actions.edit_search_line)
- map("i", "<C-e>", actions.edit_search_line)
+ map({ "i", "n" }, "<CR>", actions.set_search_line)
+ map({ "i", "n" }, "<C-e>", actions.edit_search_line)
-- TODO: Find a way to insert the text... it seems hard.
-- map('i', '<C-i>', actions.insert_value, { expr = true })
@@ -1091,7 +1086,7 @@ internal.registers = function(opts)
sorter = conf.generic_sorter(opts),
attach_mappings = function(_, map)
actions.select_default:replace(actions.paste_register)
- map("i", "<C-e>", actions.edit_register)
+ map({ "i", "n" }, "<C-e>", actions.edit_register)
return true
end,