From fb842dfc224d2c40b70648b0ee789304e43ade6c Mon Sep 17 00:00:00 2001 From: James Trew <66286082+jamestrew@users.noreply.github.com> Date: Tue, 4 Mar 2025 09:59:37 -0500 Subject: 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. --- runtime/lua/vim/diagnostic.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 26f0011e82..4749f94b1b 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -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 -- cgit