Press <C-q>. In above example code, it'll clear text of textArea.
Press <C-z> to undo
Then get the panic
panic: runtime error: index out of range [1] with length 0 [recovered]
panic: runtime error: index out of range [1] with length 0
goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1()
/home/xun/go/pkg/mod/github.com/rivo/tview@v0.0.0-20230406072732-e22ce9588bb4/application.go:251 +0x4d
panic({0x548f20, 0xc00048e018})
/usr/lib/go/src/runtime/panic.go:884 +0x213
github.com/rivo/tview.(*TextArea).InputHandler.func1(0xc000486220, 0x10?)
/home/xun/go/pkg/mod/github.com/rivo/tview@v0.0.0-20230406072732-e22ce9588bb4/textarea.go:2189 +0x3258
github.com/rivo/tview.(*Box).WrapInputHandler.func1(0xc000152000?, 0xc000147e58?)
/home/xun/go/pkg/mod/github.com/rivo/tview@v0.0.0-20230406072732-e22ce9588bb4/box.go:167 +0x53
github.com/rivo/tview.(*Application).Run(0xc00014c000)
/home/xun/go/pkg/mod/github.com/rivo/tview@v0.0.0-20230406072732-e22ce9588bb4/application.go:344 +0x57d
main.main()
/home/xun/waste/gotest/tui/main.go:24 +0x7e
To reproduce
<C-q>
. In above example code, it'll clear text of textArea.<C-z>
to undoThen get the panic