aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-04-07 13:00:00 +0200
committerKim Alvefur <zash@zash.se>2023-04-07 13:00:00 +0200
commit8b33e79fdb3b4f9bc1bb9d634265bcd49c1ad5c2 (patch)
treebe1e90c953dc0eeafc6ff97fbf5455d0e98d53ee /util
parent44689ccfd43b7c534c5a77d8bc05216b26defd6f (diff)
downloadprosody-8b33e79fdb3b4f9bc1bb9d634265bcd49c1ad5c2.tar.gz
prosody-8b33e79fdb3b4f9bc1bb9d634265bcd49c1ad5c2.zip
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.
Diffstat (limited to 'util')
-rw-r--r--util/human/io.lua2
1 files changed, 1 insertions, 1 deletions
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 "";