From 967572931718bb28b84803292dba80d8f4b72536 Mon Sep 17 00:00:00 2001 From: Eloi Charpentier Date: Fri, 11 Dec 2020 08:07:31 +0100 Subject: [PATCH] truncate quotes when they are too long --- Kaamelol.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Kaamelol.lua b/Kaamelol.lua index f7c7c6d..f35fa33 100644 --- a/Kaamelol.lua +++ b/Kaamelol.lua @@ -51,7 +51,11 @@ function kaamelol_search(msg) local file = entry["FILE"] if string.find(string.upper(title), string.upper(msg)) then - print(i, file, ":", title) + max_length = 256 + if string.len(title) > max_length then + title = string.sub(title, 1, max_length) .. '...' + end + print(i, ":", title) end end return true -- 1.7.9.5