From 3fd145007c2ecc3dc3ec8f596eb4e13a7e7fd4b5 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Fri, 17 Sep 2021 08:53:08 -0600 Subject: [PATCH] fix(diagnostic): fix wrong data type in setqflist() --- runtime/lua/vim/diagnostic.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 })