From c25a3bf0eb5b14a4fe7256becd7bf52eafa1bc0d Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Sat, 29 Mar 2025 22:07:31 +0100 Subject: [PATCH] Fix string.find with plain = true --- common/space_lua/stdlib/string.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/space_lua/stdlib/string.ts b/common/space_lua/stdlib/string.ts index 7827aa32..43157e17 100644 --- a/common/space_lua/stdlib/string.ts +++ b/common/space_lua/stdlib/string.ts @@ -105,7 +105,7 @@ export const stringApi = new LuaTable({ // Plain const index = s.indexOf(pattern, init - 1); return (index === -1) - ? new LuaMultiRes([]) + ? null : new LuaMultiRes([index + 1, index + pattern.length]); }, ),