fix: send_to_quickfix opens loclist when specified (#687)

* fix `send_to_quickfix` opening qf when the target is `loclist`

* fix indentation
This commit is contained in:
Zijian 2025-11-22 02:45:13 +01:00 committed by GitHub
parent 7e1cd7703f
commit 01cb3a8ad7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -823,11 +823,12 @@ M.send_to_quickfix = function(opts)
local action = opts.action == "a" and "a" or "r"
if opts.target == "loclist" then
vim.fn.setloclist(0, {}, action, { title = qf_title, items = qf_entries })
vim.cmd.lopen()
else
vim.fn.setqflist({}, action, { title = qf_title, items = qf_entries })
vim.cmd.copen()
end
vim.api.nvim_exec_autocmds("QuickFixCmdPost", {})
vim.cmd.copen()
end
---@return boolean