From 866cd17dd7d760e2653686c1c31c96dee58d09bc Mon Sep 17 00:00:00 2001 From: burrowing-owl Date: Mon, 4 May 2020 12:59:31 -0400 Subject: Fix array out of bounds error --- lib/ui/textinput.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/ui/textinput.go') diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go index f7301fb3..f6b0c725 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 -- cgit