# HG changeset patch # User Matthew Wild # Date 1680789825 -3600 # Node ID 1023c3faffacb266565330895dfe350f25793a6e # Parent 1f89a2a9f532e8a4a21e78a2f16676590607574f util.human.io: Fix pattern to support fractional proportions diff -r 1f89a2a9f532 -r 1023c3faffac util/human/io.lua --- a/util/human/io.lua Thu Apr 06 14:51:52 2023 +0100 +++ b/util/human/io.lua Thu Apr 06 15:03:45 2023 +0100 @@ -139,14 +139,14 @@ 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