diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-10-06 13:28:08 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-10-06 13:28:08 +0200 |
| commit | 59d46b01ce5985d51c7b761b948060aa8b11d35b (patch) | |
| tree | 858342e5de7836c4dbc79b298b10d89c2f5c47b2 | |
| parent | 34c43da3f7c9cf4802c429b10a8308c6a3f9fb7a (diff) | |
| download | vis-lspc-59d46b01ce5985d51c7b761b948060aa8b11d35b.tar.gz vis-lspc-59d46b01ce5985d51c7b761b948060aa8b11d35b.zip | |
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
| -rw-r--r-- | init.lua | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 |
