aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/diagnostic.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/diagnostic.lua')
-rw-r--r--runtime/lua/vim/diagnostic.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua
index 961e071273..3f41ee5df8 100644
--- a/runtime/lua/vim/diagnostic.lua
+++ b/runtime/lua/vim/diagnostic.lua
@@ -249,7 +249,7 @@ end
---@private
local function diagnostic_lines(diagnostics)
if not diagnostics then
- return
+ return {}
end
local diagnostics_by_line = {}
@@ -379,7 +379,7 @@ end
---@param diagnostics table: The diagnostics to display
---@return table {popup_bufnr, win_id}
local function show_diagnostics(opts, diagnostics)
- if vim.tbl_isempty(diagnostics) then
+ if not diagnostics or vim.tbl_isempty(diagnostics) then
return
end
local lines = {}