From 7100d588280a514857e9e801b6a1bb6003b5d46a Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 9 Apr 2023 01:34:08 +0200 Subject: 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. --- util/human/io.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/human') diff --git a/util/human/io.lua b/util/human/io.lua index c2ed4904..bd499664 100644 --- a/util/human/io.lua +++ b/util/human/io.lua @@ -123,7 +123,7 @@ end 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 -- cgit v1.2.3