~delthas/senpai#144: 
Crash on Control+E

Found by triallax:

if the column number is small enough, and you have some text (e.g. foo), and you press Ctrl+E, senpai panicks

panic: runtime error: index out of range [4] with length 4

goroutine 1 [running]:
git.sr.ht/~taiite/senpai/ui.(*Editor).End(...)
        git.sr.ht/~taiite/senpai/ui/editor.go:335
git.sr.ht/~taiite/senpai/ui.(*UI).InputEnd(...)
        git.sr.ht/~taiite/senpai/ui/ui.go:399
git.sr.ht/~taiite/senpai.(*App).handleKeyEvent(0xc0001fe200, 0x55fe719c5a7b?)
        git.sr.ht/~taiite/senpai/app.go:577 +0x1079
git.sr.ht/~taiite/senpai.(*App).handleUIEvent(0xc00059f8f0?, {0x55fe71bebfe0?, 0xc0006b2320?})
        git.sr.ht/~taiite/senpai/app.go:473 +0x96
git.sr.ht/~taiite/senpai.(*App).handleEvent(0x55fe7185245e?, {{0x55fe718d8118?, 0xc00059f9c8?}, {0x55fe71bebfe0?, 0xc0006b2320?}})
        git.sr.ht/~taiite/senpai/app.go:282 +0x3b
git.sr.ht/~taiite/senpai.(*App).eventLoop(0xc000
1fe200)
        git.sr.ht/~taiite/senpai/app.go:226 +0x139
git.sr.ht/~taiite/senpai.(*App).Run(0xc0001fe200)
        git.sr.ht/~taiite/senpai/app.go:199 +0x125
main.main()
        git.sr.ht/~taiite/senpai/cmd/senpai/main.go:149 +0x805
Status
REPORTED
Submitter
~delthas
Assigned to
No-one
Submitted
4 months ago
Updated
4 months ago
Labels
bug