From 7e50781f519fcad5c33b570e1996a8026841adc3 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 6 Apr 2023 15:03:45 +0100 Subject: util.human.io: Fix pattern to support fractional proportions --- util/human/io.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/human/io.lua b/util/human/io.lua index e5b22d50..9ecbe854 100644 --- a/util/human/io.lua +++ b/util/human/io.lua @@ -139,14 +139,14 @@ local function new_table(col_specs, max_width) local total_proportional_width = 0; for i = 1, #col_specs do if not widths[i] then - local width_spec = col_specs[i].width:match("(%d+)[p%%]"); + local width_spec = col_specs[i].width:match("([%d%.]+)[p%%]"); total_proportional_width = total_proportional_width + tonumber(width_spec); end end for i = 1, #col_specs do if not widths[i] then - local width_spec = col_specs[i].width:match("(%d+)[p%%]"); + local width_spec = col_specs[i].width:match("([%d%.]+)[p%%]"); local rel_width = tonumber(width_spec); widths[i] = math.floor(free_width*(rel_width/total_proportional_width)); end -- cgit v1.2.3