fix(diagnostic): silence :chistory #31701

vim.diagnostic.set_list() uses chistory to restore the actively selected
entry whenever necessary. This however also results in it displaying
some output in the message bar, but this output isn't useful (and can
even be distracting) when opening the quickfix window. This fixes this
by silencing the chistory command.
This commit is contained in:
Yorick Peterse
2024-12-23 20:57:15 +01:00
committed by GitHub
parent ffaab09e99
commit 4cbeb6fa3c

View File

@ -874,7 +874,7 @@ local function set_list(loclist, opts)
if not loclist then
-- First navigate to the diagnostics quickfix list.
local nr = vim.fn.getqflist({ id = qf_id, nr = 0 }).nr
api.nvim_command(nr .. 'chistory')
api.nvim_command(('silent %dchistory'):format(nr))
-- Now open the quickfix list.
api.nvim_command('botright cwindow')