Software /
code /
prosody
Comparison
util/human/io.lua @ 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 |
parent | 13038:83b93ad08b23 |
child | 13040:0cbe400ebab4 |
comparison
equal
deleted
inserted
replaced
13038:83b93ad08b23 | 13039:9ddb344b9fab |
---|---|
174 v = padleft(v, width); | 174 v = padleft(v, width); |
175 else | 175 else |
176 v = padright(v, width); | 176 v = padright(v, width); |
177 end | 177 end |
178 elseif len(v) > width then | 178 elseif len(v) > width then |
179 v = ellipsis(v, width); | 179 v = (column.ellipsis or ellipsis)(v, width); |
180 end | 180 end |
181 table.insert(output, v); | 181 table.insert(output, v); |
182 end | 182 end |
183 return table.concat(output, separator); | 183 return table.concat(output, separator); |
184 end; | 184 end; |