fix issue with negative padding

This commit is contained in:
Jorge Morante 2023-08-12 13:17:54 +02:00
parent d7610fd277
commit b2556345a0
1 changed files with 2 additions and 1 deletions

View File

@ -75,7 +75,8 @@ module Fingers
result = line.gsub(pattern) { |_m| replace($~) }
result = Fingers.config.backdrop_format + result
double_width_correction = ((line.bytesize - line.size) / 3).round.to_i
padding = " " * (width - line.size - double_width_correction)
padding_amount = (width - line.size - double_width_correction)
padding = padding_amount > 0 ? " " * padding_amount : ""
output.print(result + padding + ending)
end