aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-10-06 13:28:08 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2023-10-06 13:30:09 +0200
commit39311199b4970ae030addd84545f10663ea112e4 (patch)
tree3cf7db0c6285751dbb026a6531df2a70deb53fc9 /init.lua
parentefd5262f2c45d3289e482b1091d3c1d44cf67a42 (diff)
downloadvis-lspc-39311199b4970ae030addd84545f10663ea112e4.tar.gz
vis-lspc-39311199b4970ae030addd84545f10663ea112e4.zip
fix diagnostics line highlightingv0.2.1v0.2.x
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
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua7
1 files 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