Browse Source

lsp: fix off-by-one in line diagnostic highlighting

pull/14336/merge
Marco Hinz 4 weeks ago
parent
commit
6b16ec701e
No known key found for this signature in database GPG Key ID: 1C980A1B657B4A4F
  1. 2
      runtime/lua/vim/lsp/diagnostic.lua

2
runtime/lua/vim/lsp/diagnostic.lua

@ -1140,7 +1140,7 @@ function M.show_line_diagnostics(opts, bufnr, line_nr, client_id)
local message_lines = vim.split(diagnostic.message, '\n', true)
table.insert(lines, prefix..message_lines[1])
table.insert(highlights, {#prefix + 1, hiname})
table.insert(highlights, {#prefix, hiname})
for j = 2, #message_lines do
table.insert(lines, message_lines[j])
table.insert(highlights, {0, hiname})

Loading…
Cancel
Save