Skip to content

Commit

Permalink
chore(utils.ansiline): re enable diagnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
danielefongo committed Apr 24, 2024
1 parent b2297e8 commit 2e9c128
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lua/microscope/utils/ansiline.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---@diagnostic disable: cast-local-type

return function(input, truncate_len)
local valid_chars = 0
local skipped_chars = 0
local idx = 1

local ansi_start = 1
local ansi_end = 1
local ansi_start
local ansi_end
local new_ansi_end

while true do
Expand All @@ -17,7 +15,7 @@ return function(input, truncate_len)
elseif ansi_start == 1 then
skipped_chars = skipped_chars + new_ansi_end - ansi_start + 1
else
valid_chars = valid_chars + ansi_start - ansi_end - 1
valid_chars = valid_chars + ansi_start - (ansi_end or 1) - 1
if valid_chars > truncate_len then
break
end
Expand Down

0 comments on commit 2e9c128

Please sign in to comment.