1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-20 14:54:31 +01:00

Fix: Exception when decreasing indent.

Fix to prevent an exception when decreasing indents if the length
of the last line of file is less than the indent width.
This commit is contained in:
Shigeru KANEMOTO 2013-02-13 00:18:40 +09:00 committed by Cristian Maglie
parent 6a721ab52a
commit 5e17ae84a2

View File

@ -1151,7 +1151,11 @@ public class JEditTextArea extends JComponent
newBias = true;
}
if(newStart < 0 || newEnd > getDocumentLength())
if (newEnd > getDocumentLength()) {
newEnd = getDocumentLength();
}
if(newStart < 0)
{
throw new IllegalArgumentException("Bounds out of"
+ " range: " + newStart + "," +