diff options
author | Juan Cruz De La Torre <delatorrejuanchi@gmail.com> | 2024-12-16 11:38:57 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-16 06:38:57 -0800 |
commit | 6c975515c5608b500ac96fae598f0b5a48e03ddb (patch) | |
tree | 0eb38ffca9eaadffd1712d916904f894635b922b /runtime/lua/vim/diagnostic.lua | |
parent | 798f9284793ad9693c68352f5d07dafb73fd281e (diff) | |
download | rneovim-6c975515c5608b500ac96fae598f0b5a48e03ddb.tar.gz rneovim-6c975515c5608b500ac96fae598f0b5a48e03ddb.tar.bz2 rneovim-6c975515c5608b500ac96fae598f0b5a48e03ddb.zip |
fix(diagnostic): vim.diagnostic.setqflist() opens loclist on first call #31585
Problem:
Regression from de794f2d2409: `vim.diagnostic.setqflist{open=true}` attempts to
open the location list instead of the diagnostics quickfix list if it didn't
exist before. This is because we are using `qf_id` to decide which to open, but
`qf_id=nil` when there is no existing diagnostics quickfix list with a given
title ("Diagnostics" by default).
Solution:
- Revert to using `loclist` to decide which to open.
- Add tests.
Diffstat (limited to 'runtime/lua/vim/diagnostic.lua')
-rw-r--r-- | runtime/lua/vim/diagnostic.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index ded7a8f89d..39ef18e0b4 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -871,7 +871,7 @@ local function set_list(loclist, opts) end if open then - if qf_id then + 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') |