Changeset

13039:9ddb344b9fab

util.human.io: Allow defining per column ellipsis function As an alternative to doing it in the mapper function. Could be useful in cases where one may want to put the ellipsis in the middle or beginning instead of the start.
author Kim Alvefur <zash@zash.se>
date Fri, 07 Apr 2023 13:00:58 +0200
parents 13038:83b93ad08b23
children 13040:0cbe400ebab4
files util/human/io.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/human/io.lua	Fri Apr 07 13:00:00 2023 +0200
+++ b/util/human/io.lua	Fri Apr 07 13:00:58 2023 +0200
@@ -176,7 +176,7 @@
 					v = padright(v, width);
 				end
 			elseif len(v) > width then
-				v = ellipsis(v, width);
+				v = (column.ellipsis or ellipsis)(v, width);
 			end
 			table.insert(output, v);
 		end