util.human.io: Allow defining per column ellipsis function
authorKim Alvefur <zash@zash.se>
Fri, 07 Apr 2023 13:00:58 +0200
changeset 13043 9ddb344b9fab
parent 13042 83b93ad08b23
child 13044 0cbe400ebab4
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.
util/human/io.lua
--- 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