Editor widget crashes Jexer (out-of-bounds error)
Version: jexer master (gitlab)
Encountered on: xterm, gnome-terminal, Ultimate++ terminal widget.
Reproducible: Always
Steps to reproduce:
-
- Open jexer demo;
-
- Open the editor widget.
-
- Scroll/move down the EOF.
-
- Put the cursor onto the empty area, i. e the area to the right or bottom of the last line, using the mouse (the cursor color will change)
-
- Type anything.
Result: Jexer crashes:
Report:
java.lang.IndexOutOfBoundsException: Lines array size is 25, requested index 26
at jexer.teditor.Document.setLineNumber(Document.java:199)
at jexer.TEditorWidget.deleteSelection(TEditorWidget.java:840)
at jexer.TEditorWidget.onKeypress(TEditorWidget.java:416)
at jexer.TWidget.onKeypress(TWidget.java:447)
at jexer.TWindow.onKeypress(TWindow.java:740)
at jexer.TWidget.handleEvent(TWidget.java:651)
at jexer.TApplication.primaryHandleEvent(TApplication.java:1430)
at jexer.TApplication.access$700(TApplication.java:76)
at jexer.TApplication$WidgetEventHandler.runImpl(TApplication.java:491)
at jexer.TApplication$WidgetEventHandler.run(TApplication.java:401)
at java.base/java.lang.Thread.run(Thread.java:844)
p.s: As a further clue, the "requested index" varies depending on the place of the mouse click.
Edited by İsmail Yılmaz