Describe the bug
When using multiline InputField, there are at least 2 ways to get IndexError, both of them lead to app being freezed or crashed which is annoying
To Reproduce
Steps to reproduce the behavior:
Press Enter while there is no characters in the input field
On a newline, try to remove last character. If the previous line is not empty, pressing backspace will raise an error, though app does not exit and just freezes
Expected behavior
It should normally edit text
Screenshots
System information
PyTermGUI version 7.3.0
System details:
Python version: 3.10.9
$TERM: xterm-256color
$COLORTERM: truecolor
Color support: ColorSystem.TRUE
OS Platform: Linux-6.1.1-arch1-1-x86_64-with-glibc2.36
Possible cause
Both errors happen in input_field.py when trying to get self._lines[...] and is related to current row
Possible solution
Sanity check for index (row) and array length
Describe the bug When using multiline InputField, there are at least 2 ways to get IndexError, both of them lead to app being freezed or crashed which is annoying
To Reproduce Steps to reproduce the behavior:
backspace
will raise an error, though app does not exit and just freezesExpected behavior It should normally edit text
Screenshots
![image](https://user-images.githubusercontent.com/79970533/209805607-6fdee268-39dc-4773-b409-6584dd660eae.png)
System information
Possible cause Both errors happen in
input_field.py
when trying to getself._lines[...]
and is related to current rowPossible solution Sanity check for index (row) and array length