Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(actions): pass pattern name to QuickFixCmd* autocmds #2958

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading