mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
fix(diagnostic): don't return nil when callers expect a table (#15765)
diagnostic_lines() returns a table, so make the early exit condition an empty table rather than 'nil'. This way, functions that use the input from diagnostic_lines don't have to do a bunch of defensive nil checking and can always assume they're operating on a table.
This commit is contained in:
parent
abf13258cf
commit
057606e845
@ -249,7 +249,7 @@ end
|
|||||||
---@private
|
---@private
|
||||||
local function diagnostic_lines(diagnostics)
|
local function diagnostic_lines(diagnostics)
|
||||||
if not diagnostics then
|
if not diagnostics then
|
||||||
return
|
return {}
|
||||||
end
|
end
|
||||||
|
|
||||||
local diagnostics_by_line = {}
|
local diagnostics_by_line = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user