From de7f598001f37fabd372148158e616b27a38acad Mon Sep 17 00:00:00 2001 From: "M. Mert Yildiran" Date: Wed, 8 Mar 2023 01:04:20 +0300 Subject: [PATCH] :bug: Fix an issue in the script title retrieval from the first comment once more --- misc/scripting.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/scripting.go b/misc/scripting.go index 55f07147c..512ca0a96 100644 --- a/misc/scripting.go +++ b/misc/scripting.go @@ -31,17 +31,18 @@ func ReadScriptFile(path string) (script *Script, err error) { } var title string + var titleIsSet bool code := content var idx0 file.Idx for node, comments := range program.Comments { - if (idx0 > 0 && node.Idx0() > idx0) || len(comments) == 0 { + if (titleIsSet && node.Idx0() > idx0) || len(comments) == 0 { continue } - idx0 = node.Idx0() + idx0 = node.Idx0() title = comments[0].Text - break + titleIsSet = true } script = &Script{