aboutsummaryrefslogtreecommitdiff
path: root/lib/ui
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui')
-rw-r--r--lib/ui/textinput.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go
index 892646d..a3127e5 100644
--- a/lib/ui/textinput.go
+++ b/lib/ui/textinput.go
@@ -46,6 +46,14 @@ func (ti *TextInput) String() string {
return string(ti.text)
}
+func (ti *TextInput) StringLeft() string {
+ return string(ti.text[:ti.index])
+}
+
+func (ti *TextInput) StringRight() string {
+ return string(ti.text[ti.index:])
+}
+
func (ti *TextInput) Set(value string) {
ti.text = []rune(value)
ti.index = len(ti.text)