diff options
author | Gregory Anders <greg@gpanders.com> | 2021-09-17 08:53:08 -0600 |
---|---|---|
committer | Gregory Anders <greg@gpanders.com> | 2021-09-17 08:53:08 -0600 |
commit | 3fd145007c2ecc3dc3ec8f596eb4e13a7e7fd4b5 (patch) | |
tree | e3158969acbbacf39f132b1c12ae6211ae7605e0 /runtime/lua/vim/diagnostic.lua | |
parent | 71e0e6cc63876e9088c1f25ca600fb4397ce2243 (diff) | |
download | rneovim-3fd145007c2ecc3dc3ec8f596eb4e13a7e7fd4b5.tar.gz rneovim-3fd145007c2ecc3dc3ec8f596eb4e13a7e7fd4b5.tar.bz2 rneovim-3fd145007c2ecc3dc3ec8f596eb4e13a7e7fd4b5.zip |
fix(diagnostic): fix wrong data type in setqflist()
Diffstat (limited to 'runtime/lua/vim/diagnostic.lua')
-rw-r--r-- | runtime/lua/vim/diagnostic.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 59349a3f3d..8f73740dad 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -410,7 +410,11 @@ local function set_list(loclist, opts) local open = vim.F.if_nil(opts.open, true) local title = opts.title or "Diagnostics" local winnr = opts.winnr or 0 - local diagnostics = M.get(loclist and vim.api.nvim_win_get_buf(winnr), opts) + local bufnr + if loclist then + bufnr = vim.api.nvim_win_get_buf(winnr) + end + local diagnostics = M.get(bufnr, opts) local items = diagnostics_to_list_items(diagnostics) if loclist then vim.fn.setloclist(winnr, {}, ' ', { title = title, items = items }) |