# HG changeset patch # User Kim Alvefur # Date 1591288353 -7200 # Node ID 18dc4639442eba80aeb86f6e4f35e91346e76197 # Parent 6af28c7567529baa7e3d645e95a8b475c7f890d1 util.human.io: Replace overflow with ellipsis diff -r 6af28c756752 -r 18dc4639442e util/human/io.lua --- a/util/human/io.lua Thu Jun 04 18:31:50 2020 +0200 +++ b/util/human/io.lua Thu Jun 04 18:32:33 2020 +0200 @@ -128,13 +128,15 @@ local output = {}; for i, column in ipairs(col_specs) do local width = widths[i]; - local v = tostring(row[not titles and column.key or i] or ""):sub(1, width); + local v = tostring(row[not titles and column.key or i] or ""); if #v < width then if column.align == "right" then v = padleft(v, width-1).." "; else v = padright(v, width); end + elseif #v > width then + v = v:sub(1, width-1) .. "\u{2026}"; end table.insert(output, v); end