Changeset

13067:386ca97bec5b

util.human.io: Fix error with ellipsis to negative length Can happen if you resize the terminal too narrow that the space left for variable width columns end up negative.
author Kim Alvefur <zash@zash.se>
date Sun, 09 Apr 2023 01:34:08 +0200
parents 13066:4aa4a51a7a77
children 13068:7a75cbc4d87c
files util/human/io.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/human/io.lua	Sat Apr 08 12:56:13 2023 +0200
+++ b/util/human/io.lua	Sun Apr 09 01:34:08 2023 +0200
@@ -123,7 +123,7 @@
 
 local function ellipsis(s, width)
 	if len(s) <= width then return s; end
-	if width == 1 then return "…"; end
+	if width <= 1 then return "…"; end
 	return utf8_cut(s, width - 1) .. "…";
 end