feat: add search history picker (#769)

Co-authored-by: Volodymyr Kot <vkot@palantir.com>
This commit is contained in:
Volodymyr Kot
2021-04-23 16:24:09 +01:00
committed by GitHub
parent a28999574e
commit 712de3e182
5 changed files with 46 additions and 0 deletions

View File

@@ -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)