From 343a2b6b712eb42ae5a319d484508cc5e9e483b0 Mon Sep 17 00:00:00 2001 From: kyoh86 Date: Mon, 28 Nov 2022 04:03:03 +0900 Subject: feat: add new action to open quickfix window from quickfixhistory (#2249) --- lua/telescope/builtin/__internal.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/telescope/builtin/__internal.lua b/lua/telescope/builtin/__internal.lua index d0f32a3..7f85916 100644 --- a/lua/telescope/builtin/__internal.lua +++ b/lua/telescope/builtin/__internal.lua @@ -449,12 +449,19 @@ internal.quickfixhistory = function(opts) end, }, sorter = conf.generic_sorter(opts), - attach_mappings = function(_, _) + attach_mappings = function(_, map) action_set.select:replace(function(prompt_bufnr) local nr = action_state.get_selected_entry().nr actions.close(prompt_bufnr) internal.quickfix { nr = nr } end) + + map({ "i", "n" }, "", function(prompt_bufnr) + local nr = action_state.get_selected_entry().nr + actions.close(prompt_bufnr) + vim.cmd(nr .. "chistory") + vim.cmd "copen" + end) return true end, }) -- cgit v1.2.3