diff options
-rw-r--r-- | lib/ui/textinput.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go index 8bc32b06..f09ebb43 100644 --- a/lib/ui/textinput.go +++ b/lib/ui/textinput.go @@ -70,6 +70,9 @@ func (ti *TextInput) String() string { } func (ti *TextInput) StringLeft() string { + for ti.index >= len(ti.text) { + ti.index = len(ti.text) - 1 + } return string(ti.text[:ti.index]) } |