This commit is contained in:
Jorge Morante 2023-05-12 14:58:42 +02:00
parent 1a475f98f6
commit d40fa850c1
1 changed files with 3 additions and 2 deletions

View File

@ -74,8 +74,9 @@ module Fingers
def process_line(line, ending)
result = line.gsub(pattern) { |_m| replace($~) }
result = Fingers.config.backdrop_format + result
width_diff = result.size - line.size
output.print(result.ljust(width + width_diff, ' ') + ending)
double_width_correction = ((line.bytesize - line.size) / 3).round.to_i
padding = " " * (width - line.size - double_width_correction)
output.print(result + padding + ending)
end
def pattern : Regex