about summary refs log tree commit diff stats
path: root/lib/ui/textinput.go
diff options
context:
space:
mode:
authorburrowing-owl <burrowing-owl@aviary.biz>2020-05-04 12:59:31 -0400
committerReto Brunner <reto@labrat.space>2020-05-05 09:01:08 +0200
commit866cd17dd7d760e2653686c1c31c96dee58d09bc (patch)
tree41e888aa4e93a9060fb7a889a5f74cc3d08e77c4 /lib/ui/textinput.go
parent05fa79eb8efa02e39962c08231ec0e40cafe0020 (diff)
downloadaerc-866cd17dd7d760e2653686c1c31c96dee58d09bc.tar.gz
Fix array out of bounds error
Diffstat (limited to 'lib/ui/textinput.go')
-rw-r--r--lib/ui/textinput.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go
index f7301fb..f6b0c72 100644
--- a/lib/ui/textinput.go
+++ b/lib/ui/textinput.go
@@ -181,7 +181,7 @@ func (ti *TextInput) insert(ch rune) {
 
 func (ti *TextInput) deleteWord() {
 	// TODO: Break on any of / " '
-	if len(ti.text) == 0 {
+	if len(ti.text) == 0 || ti.index <= 0 {
 		return
 	}
 	i := ti.index - 1