summaryrefslogtreecommitdiff
path: root/lua/telescope/actions/init.lua
diff options
context:
space:
mode:
authorVolodymyr Kot <volodymyr.kot.ua@gmail.com>2021-04-23 16:24:09 +0100
committerGitHub <noreply@github.com>2021-04-23 18:24:09 +0300
commit712de3e18237323a979b4fd256703e2edfaddf2f (patch)
tree43abbb86063cff6cc4eea62b51d49835a70de99f /lua/telescope/actions/init.lua
parenta28999574efb7a0d5bddb2e7eb543ff7d4cf14b4 (diff)
feat: add search history picker (#769)
Co-authored-by: Volodymyr Kot <vkot@palantir.com>
Diffstat (limited to 'lua/telescope/actions/init.lua')
-rw-r--r--lua/telescope/actions/init.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua
index bee1f48..a14255b 100644
--- a/lua/telescope/actions/init.lua
+++ b/lua/telescope/actions/init.lua
@@ -234,6 +234,19 @@ actions.set_command_line = function(prompt_bufnr)
vim.cmd(entry.value)
end
+actions.edit_search_line = function(prompt_bufnr)
+ local entry = action_state.get_selected_entry(prompt_bufnr)
+ actions.close(prompt_bufnr)
+ a.nvim_feedkeys(a.nvim_replace_termcodes("/" .. entry.value , true, false, true), "t", true)
+end
+
+actions.set_search_line = function(prompt_bufnr)
+ local entry = action_state.get_selected_entry(prompt_bufnr)
+
+ actions.close(prompt_bufnr)
+ a.nvim_feedkeys(a.nvim_replace_termcodes("/" .. entry.value .. "<CR>", true, false, true), "t", true)
+end
+
actions.edit_register = function(prompt_bufnr)
local entry = action_state.get_selected_entry(prompt_bufnr)
local picker = action_state.get_current_picker(prompt_bufnr)