From 4cbeb6fa3cc764fd5605bccf7362f7a249d6df81 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 23 Dec 2024 20:57:15 +0100 Subject: 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. --- runtime/lua/vim/diagnostic.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 39ef18e0b4..90f967fe79 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -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') -- cgit