Skip to content

Commit 15becb1

Browse files
author
Raphaël CHARTIER
committed
fix: padding for multibyte chars when chunks > 1
1 parent 7e101b4 commit 15becb1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/tiny-inline-diagnostic/virtual_text.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ function M.from_diagnostic(opts, ret, index_diag, padding, total_chunks)
7979

8080
-- Process each chunk
8181
for index_chunk, chunk in ipairs(ret.chunks) do
82-
local message = format_chunk_message(chunk, padding)
82+
local message = utils.trim(chunk)
83+
if #ret.chunks > 1 then
84+
message = format_chunk_message(chunk, padding)
85+
end
8386

8487
if index_chunk == 1 then
8588
local first_chunks = build_first_chunk(

0 commit comments

Comments
 (0)