From 8b33e79fdb3b4f9bc1bb9d634265bcd49c1ad5c2 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 7 Apr 2023 13:00:00 +0200 Subject: util.human.io: Pass expected width to mapper function In order to allow it to adjust its output to available space, apply its own ellipsis method or other compacting method. --- util/human/io.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') diff --git a/util/human/io.lua b/util/human/io.lua index 9ecbe854..22c2c3ba 100644 --- a/util/human/io.lua +++ b/util/human/io.lua @@ -162,7 +162,7 @@ local function new_table(col_specs, max_width) local width = widths[i]; local v = row[not titles and column.key or i]; if not titles and column.mapper then - v = column.mapper(v, row); + v = column.mapper(v, row, width); end if v == nil then v = column.default or ""; -- cgit v1.2.3