From fd902b1cb2463e220e5bd5fe37a0cfdd259ff35a Mon Sep 17 00:00:00 2001 From: Jeremy Fleischman Date: Thu, 5 Dec 2024 13:59:33 -0800 Subject: fix(diagnostic): only store quickfix id when creating a new one #31466 The old code would always update `_qf_id` with the current quickfix, even if you're currently looking at a completely different, non-diagnostics quickfix list. This completely defeats the intent of , whoops! --- runtime/lua/vim/diagnostic.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim/diagnostic.lua') diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index dbf4f56032..b8ffb26377 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -867,7 +867,9 @@ local function set_list(loclist, opts) }) -- Get the id of the newly created quickfix list. - _qf_id = vim.fn.getqflist({ id = 0 }).id + if _qf_id == nil then + _qf_id = vim.fn.getqflist({ id = 0 }).id + end end if open then api.nvim_command(loclist and 'lwindow' or 'botright cwindow') -- cgit