LSP: Fix show_line_diagnostics #12186

Messed this up in ef0398fe88
This commit is contained in:
Mathias Fußenegger
2020-04-26 23:56:30 +02:00
committed by GitHub
parent 05a07ff7af
commit 50ff37308a
2 changed files with 27 additions and 1 deletions

View File

@@ -696,7 +696,7 @@ do
local buffer_diagnostics = M.diagnostics_by_buf[bufnr]
if not buffer_diagnostics then return end
local line_diagnostics = M.diagnostics_group_by_line(buffer_diagnostics[line])
local line_diagnostics = M.diagnostics_group_by_line(buffer_diagnostics)[line]
if not line_diagnostics then return end
for i, diagnostic in ipairs(line_diagnostics) do
@@ -707,6 +707,7 @@ do
-- TODO(ashkan) make format configurable?
local prefix = string.format("%d. ", i)
local hiname = severity_highlights[diagnostic.severity]
assert(hiname, 'unknown severity: ' .. tostring(diagnostic.severity))
local message_lines = split_lines(diagnostic.message)
table.insert(lines, prefix..message_lines[1])
table.insert(highlights, {#prefix + 1, hiname})