From 501bbff1a2867ccab964ca7a50d81cc20530c96b Mon Sep 17 00:00:00 2001 From: William Bell Date: Thu, 10 Aug 2023 12:05:04 +0100 Subject: [PATCH] fix do not working if not after space in shell --- src/shell.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/shell.go b/src/shell.go index e1f3c0a..28e8f74 100644 --- a/src/shell.go +++ b/src/shell.go @@ -31,9 +31,8 @@ func shell(global ArObject) { fmt.Print("\x1b[0m") totranslate = append(totranslate, UNPARSEcode{code, code, i, ""}) trimmed := strings.TrimSpace(code) - split := strings.Split(trimmed, " ") previous = indent - if split[len(split)-1] == "do" { + if len(trimmed) >= 2 && trimmed[len(trimmed)-2:] == "do" { indent++ } else if trimmed == "" { indent--