Skip to content

Commit 576351d

Browse files
authored
Merge pull request #98 from bezmi/offset_fix
feat: add 'padding' option to overflow options
2 parents aa6a704 + 47cb579 commit 576351d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ require("tiny-inline-diagnostic").setup({
128128
-- "none" - Do not truncate messages
129129
-- "oneline" - Keep the message on a single line, even if it's long
130130
mode = "wrap",
131+
132+
-- Trigger wrapping to occur this many characters earlier when mode == "wrap".
133+
-- Increase this value appropriately if you notice that the last few characters
134+
-- of wrapped diagnostics are sometimes obscured.
135+
padding = 0,
131136
},
132137

133138
-- Configuration for breaking long messages into separate lines

lua/tiny-inline-diagnostic/chunk.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ function M.handle_overflow_modes(opts, diag_message, need_to_be_under, win_width
295295
local ok, win_col = pcall(vim.fn.virtcol, "$")
296296
offset = ok and win_col or 0
297297
end
298+
offset = (opts.options.overflow.padding or 0) + offset
298299
chunks = M.get_message_chunks_for_overflow(diag_message, offset, win_width, opts)
299300
elseif opts.options.overflow.mode == "none" then
300301
chunks = utils.wrap_text(diag_message, 0)

0 commit comments

Comments
 (0)