From 39311199b4970ae030addd84545f10663ea112e4 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 6 Oct 2023 13:28:08 +0200 Subject: fix diagnostics line highlighting Range highlighting used the vis_range and line highlighting the LSP range. Do not touch old code you no longer understand because you think you are apparently smarter than your past self! Fixes: efd5262f2c45d3289e482b1091d3c1d44cf67a42 --- init.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 1d848d6..9b2f860 100644 --- a/init.lua +++ b/init.lua @@ -573,9 +573,8 @@ local function lspc_highlight_diagnostics(win, diagnostics, style) end for _, diagnostic in ipairs(diagnostics) do - local range = diagnostic.vis_range - if lspc.highlight_diagnostics == 'range' then + local range = diagnostic.vis_range -- make sure to highlight only ranges which actually contain the diagnostic if diagnostic.content == win.file:content(range) then win:style(style, range.start, range.finish - 1) @@ -587,8 +586,8 @@ local function lspc_highlight_diagnostics(win, diagnostics, style) return end - local start_line = range.start.line + 1 - local end_line = range['end'].line + 1 + local start_line = diagnostic.range.start.line + 1 + local end_line = diagnostic.range['end'].line + 1 for line = start_line, end_line, 1 do win:style_lineno(style, line) end -- cgit v1.2.3