From 136f2b1637ec916bad5484cef2950ce965947574 Mon Sep 17 00:00:00 2001 From: luk3yx Date: Sat, 14 Sep 2024 20:23:12 +1200 Subject: [PATCH] Explain why string.len is used --- init.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.lua b/init.lua index 09ad63f..bb3a4c1 100644 --- a/init.lua +++ b/init.lua @@ -36,6 +36,8 @@ local function naive_str_width(str) local prev_w = 0 local line_count = 1 local i = 1 + -- string.len() is used so that numbers are coerced to strings without any + -- extra checking local str_length = strlen(str) while i <= str_length do local char = byte(str, i)