Skip to content

Commit

Permalink
fix: improve diag overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rachartier committed Jul 13, 2024
1 parent d00bfb9 commit a6663fd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions lua/tiny-inline-diagnostic/chunck.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ function M.get_message_chunks_for_overflow(

local distance = win_width - offset - signs_total_text_len

if distance < opts.options.softwrap then
distance = win_width - signs_total_text_len
end
-- if distance < opts.options.softwrap then
-- distance = win_width - signs_total_text_len - #message
-- print("distance", distance)
-- end

local message_chunk = {}
message_chunk = utils.wrap_text(message, distance)
Expand Down
3 changes: 2 additions & 1 deletion lua/tiny-inline-diagnostic/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ local function apply_diagnostics_virtual_texts(opts, event)
local buf_lines_count = vim.api.nvim_buf_line_count(event.buf)

local total_lines = #virt_lines
if total_lines >= buf_lines_count - 1 then
print("total_lines", total_lines, buf_lines_count - 1)
if curline - 1 + total_lines > buf_lines_count - 1 then
diag_overflow_last_line = true
end

Expand Down
2 changes: 1 addition & 1 deletion lua/tiny-inline-diagnostic/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ local default_config = {
},
options = {
throttle = 20,
softwrap = 15,
softwrap = 30,
multiple_diag_under_cursor = true,
overflow = {
mode = "wrap",
Expand Down

0 comments on commit a6663fd

Please sign in to comment.