Skip to content

Commit

Permalink
fix(actions): pass pattern name to QuickFixCmd* autocmds
Browse files Browse the repository at this point in the history
closes #2955
  • Loading branch information
jamestrew committed Feb 28, 2024
1 parent d5c4d98 commit 7aca7c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/telescope/actions/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -927,15 +927,15 @@ local send_selected_to_qf = function(prompt_bufnr, mode, target)
local prompt = picker:_get_prompt()
actions.close(prompt_bufnr)

vim.api.nvim_exec_autocmds("QuickFixCmdPre", {})
vim.api.nvim_exec_autocmds("QuickFixCmdPre", { pattern = "Telescope" })
if target == "loclist" then
vim.fn.setloclist(picker.original_win_id, qf_entries, mode)
else
local qf_title = string.format([[%s (%s)]], picker.prompt_title, prompt)
vim.fn.setqflist(qf_entries, mode)
vim.fn.setqflist({}, "a", { title = qf_title })
end
vim.api.nvim_exec_autocmds("QuickFixCmdPost", {})
vim.api.nvim_exec_autocmds("QuickFixCmdPost", { pattern = "Telescope" })
end

local send_all_to_qf = function(prompt_bufnr, mode, target)
Expand All @@ -950,7 +950,7 @@ local send_all_to_qf = function(prompt_bufnr, mode, target)
local prompt = picker:_get_prompt()
actions.close(prompt_bufnr)

vim.api.nvim_exec_autocmds("QuickFixCmdPre", {})
vim.api.nvim_exec_autocmds("QuickFixCmdPre", { pattern = "Telescope" })
local qf_title = string.format([[%s (%s)]], picker.prompt_title, prompt)
if target == "loclist" then
vim.fn.setloclist(picker.original_win_id, qf_entries, mode)
Expand All @@ -959,7 +959,7 @@ local send_all_to_qf = function(prompt_bufnr, mode, target)
vim.fn.setqflist(qf_entries, mode)
vim.fn.setqflist({}, "a", { title = qf_title })
end
vim.api.nvim_exec_autocmds("QuickFixCmdPost", {})
vim.api.nvim_exec_autocmds("QuickFixCmdPost", { pattern = "Telescope" })
end

--- Sends the selected entries to the quickfix list, replacing the previous entries.
Expand Down

0 comments on commit 7aca7c7

Please sign in to comment.