Hi, Just wondering if supporting something like this would be possible. I am using Trouble for Diagnostics, quickfix etc.
Currently I am using an autocmd to hook into when the quickfix list is opened to swap to using trouble:
vim.api.nvim_create_augroup("trouble-quickfix", { clear = true })
vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
group = "trouble-quickfix",
callback = function()
if vim.bo.buftype == "quickfix" then
print(#(vim.fn.getqflist()))
if #(vim.fn.getqflist()) > 0 then
vim.schedule(function()
vim.cmd("Trouble quickfix")
end)
vim.schedule(function()
vim.cmd("ccl")
end)
else
vim.schedule(function()
vim.cmd("TroubleClose")
end)
end
end
end,
})
However this does mean this behaviour isn't scoped to just tsc errors. Would it be possible to expose an on_qflist_open callback to allow scoping this kind of behaviour?
Hi, Just wondering if supporting something like this would be possible. I am using Trouble for Diagnostics, quickfix etc.
Currently I am using an autocmd to hook into when the quickfix list is opened to swap to using trouble:
However this does mean this behaviour isn't scoped to just tsc errors. Would it be possible to expose an
on_qflist_open
callback to allow scoping this kind of behaviour?Happy to make a PR if this would be of interest
Cheers