diff options
author | Jeremy Fleischman <jeremyfleischman@gmail.com> | 2024-12-05 13:59:33 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-05 13:59:33 -0800 |
commit | fd902b1cb2463e220e5bd5fe37a0cfdd259ff35a (patch) | |
tree | caae868cbe3f20da515ceafd70c100249e457867 /runtime/lua/vim/diagnostic.lua | |
parent | 12901447cb21c7d6628c7c7e60e1bda2e5c0b793 (diff) | |
download | rneovim-fd902b1cb2463e220e5bd5fe37a0cfdd259ff35a.tar.gz rneovim-fd902b1cb2463e220e5bd5fe37a0cfdd259ff35a.tar.bz2 rneovim-fd902b1cb2463e220e5bd5fe37a0cfdd259ff35a.zip |
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
<https://github.com/neovim/neovim/pull/30868>, whoops!
Diffstat (limited to 'runtime/lua/vim/diagnostic.lua')
-rw-r--r-- | runtime/lua/vim/diagnostic.lua | 4 |
1 files changed, 3 insertions, 1 deletions
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') |