Empyreus / lanterna

Automatically exported from code.google.com/p/lanterna
GNU Lesser General Public License v3.0
0 stars 0 forks source link

<TextBox>.setText("") crashes if there is a text overflow #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
My app has a clear button which resets the text to an empty String.  Most uses 
appear to work fine, but if the cursor has typed enough such that the textbox 
scrolls to the right and not all text is visible at once, then setText("") will 
cause the program to crash with a large scrolling stack trace to be printed on 
the screen.

This appears to be very reproducible and has worked with every textbox size 
I've tried.  For instance, if you have a size 5 textbox and type 5 characters, 
the box will scroll and the first character will not be visible.  This will 
crash the program   Likewise, typing 5 characters and deleting one (which 
doesn't scroll the window back to the left) will also cause the program to 
crash.

OS: Linux Mint 14
Java: openjdk 1.7.0_15
Terminal: ROXTerm

Original issue reported on code.google.com by bmwest.c...@gmail.com on 3 Mar 2013 at 5:18

GoogleCodeExporter commented 9 years ago
Ah, yeah, that would be a problem...

Original comment by mab...@gmail.com on 7 Mar 2013 at 6:20

GoogleCodeExporter commented 9 years ago
Pushed a bugfix on 2.1.x branch now, it will fix this particular scenario but I 
wouldn't be surprised if there are more problems in this class related to 
changing strings programmatically and the edit cursor position. Hopefully the 
GUI rewrite in next release can fix this.

Original comment by mab...@gmail.com on 7 Mar 2013 at 6:33