summaryrefslogtreecommitdiff
path: root/lua/telescope
diff options
context:
space:
mode:
authorkyoh86 <me@kyoh86.dev>2022-11-28 04:03:03 +0900
committerGitHub <noreply@github.com>2022-11-27 20:03:03 +0100
commit343a2b6b712eb42ae5a319d484508cc5e9e483b0 (patch)
tree23322c84ebccdd607394527d42d9dce5db924c0f /lua/telescope
parentcea9c75c19d172d2c6f089f21656019734a615cf (diff)
feat: add new action to open quickfix window from quickfixhistory (#2249)
Diffstat (limited to 'lua/telescope')
-rw-r--r--lua/telescope/builtin/__internal.lua9
1 files changed, 8 insertions, 1 deletions
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" }, "<C-q>", 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,
})