summaryrefslogtreecommitdiff
path: root/helpfuncs.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-12-21 11:39:36 +0300
committerGrail Finder <wohilas@gmail.com>2025-12-21 11:39:36 +0300
commit75fde2a575697f8f46ee9676c0ed228e5315a4e5 (patch)
tree64e02a6afef049eb2ca79a3a5d2b0beb8ba26385 /helpfuncs.go
parent1ca75a00642c4e0a6eea3117e3b4ebaacfdcfa7a (diff)
parent5525c946613a6f726cd116d79f1505a63ab25806 (diff)
Merge branch 'master' into doc/tutorial
Diffstat (limited to 'helpfuncs.go')
-rw-r--r--helpfuncs.go24
1 files changed, 23 insertions, 1 deletions
diff --git a/helpfuncs.go b/helpfuncs.go
index df49ae5..30d9967 100644
--- a/helpfuncs.go
+++ b/helpfuncs.go
@@ -8,8 +8,20 @@ import (
"os"
"path"
"strings"
+ "unicode"
+
+ "math/rand/v2"
)
+func isASCII(s string) bool {
+ for i := 0; i < len(s); i++ {
+ if s[i] > unicode.MaxASCII {
+ return false
+ }
+ }
+ return true
+}
+
func colorText() {
text := textView.GetText(false)
quoteReplacer := strings.NewReplacer(
@@ -63,7 +75,7 @@ func colorText() {
}
func updateStatusLine() {
- position.SetText(makeStatusLine())
+ statusLineWidget.SetText(makeStatusLine())
helpView.SetText(fmt.Sprintf(helpText, makeStatusLine()))
}
@@ -229,3 +241,13 @@ func makeStatusLine() string {
isRecording, persona, botPersona, injectRole)
return statusLine + imageInfo + shellModeInfo
}
+
+var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
+
+func randString(n int) string {
+ b := make([]rune, n)
+ for i := range b {
+ b[i] = letters[rand.IntN(len(letters))]
+ }
+ return string(b)
+}