fix(diagnostic): virtual_lines diagnostic columns (#32703)

When multiple diagnostics appear on a single line, the virtual lines for
all diagnostics except the first were rendered with progressively fewer
columns.
This commit is contained in:
James Trew
2025-03-04 09:59:37 -05:00
committed by GitHub
parent 859dbb6619
commit fb842dfc22
2 changed files with 105 additions and 2 deletions

View File

@@ -1757,8 +1757,7 @@ local function render_virtual_lines(namespace, bufnr, diagnostics)
string.rep(
' ',
-- +1 because indexing starts at 0 in one API but at 1 in the other.
-- -1 for non-first lines, since the previous column was already drawn.
distance_between_cols(bufnr, diag.lnum, prev_col + 1, diag.col) - 1
distance_between_cols(bufnr, diag.lnum, prev_col + 1, diag.col)
),
})
else