summaryrefslogtreecommitdiff
path: root/area.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-29 11:25:25 -0700
committerJeff Carr <[email protected]>2019-05-29 11:25:25 -0700
commit69e42973663c826ad8143e64d951ba6eaf63d995 (patch)
tree4dbe432259b14aca79f6b64caf9adb0697dde806 /area.go
parent5bc0e15b3d163d3b2eadb1e25654ed0147b8f880 (diff)
remove the myAH stand alone variable
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'area.go')
-rw-r--r--area.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/area.go b/area.go
index 73279aa..8109232 100644
--- a/area.go
+++ b/area.go
@@ -63,6 +63,15 @@ func makeSplashArea(ah *AreaHandler) {
}
}
+func AreaAppendText(newText *ui.AttributedString, what string, attrs ...ui.Attribute) {
+ start := len(newText.String())
+ end := start + len(what)
+ newText.AppendUnattributed(what)
+ for _, a := range attrs {
+ newText.SetAttribute(a, start, end)
+ }
+}
+
func appendWithAttributes(newText *ui.AttributedString, what string, attrs ...ui.Attribute) {
start := len(newText.String())
end := start + len(what)