Mercurial > prosody-hg
diff util/human/io.lua @ 13038:83b93ad08b23
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.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 07 Apr 2023 13:00:00 +0200 |
| parents | 1023c3faffac |
| children | 9ddb344b9fab |
line wrap: on
line diff
--- a/util/human/io.lua Fri Apr 07 12:58:02 2023 +0200 +++ b/util/human/io.lua Fri Apr 07 13:00:00 2023 +0200 @@ -162,7 +162,7 @@ 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 "";
