aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/diagnostic.lua
diff options
context:
space:
mode:
authorJames Trew <66286082+jamestrew@users.noreply.github.com>2025-03-04 09:59:37 -0500
committerGitHub <noreply@github.com>2025-03-04 08:59:37 -0600
commitfb842dfc224d2c40b70648b0ee789304e43ade6c (patch)
treeceb6ea20674a3357de19ccc353b75915dd72ce57 /runtime/lua/vim/diagnostic.lua
parent859dbb6619e5bea66fe178680091edaef376f94a (diff)
downloadrneovim-fb842dfc224d2c40b70648b0ee789304e43ade6c.tar.gz
rneovim-fb842dfc224d2c40b70648b0ee789304e43ade6c.tar.bz2
rneovim-fb842dfc224d2c40b70648b0ee789304e43ade6c.zip
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.
Diffstat (limited to 'runtime/lua/vim/diagnostic.lua')
-rw-r--r--runtime/lua/vim/diagnostic.lua3
1 files changed, 1 insertions, 2 deletions
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