Skip to content

Commit 5e17ae8

Browse files
Shigeru KANEMOTOcmaglie
authored andcommitted
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.
1 parent 6a721ab commit 5e17ae8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/src/processing/app/syntax/JEditTextArea.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,11 @@ public void select(int start, int end)
11511151
newBias = true;
11521152
}
11531153

1154-
if(newStart < 0 || newEnd > getDocumentLength())
1154+
if (newEnd > getDocumentLength()) {
1155+
newEnd = getDocumentLength();
1156+
}
1157+
1158+
if(newStart < 0)
11551159
{
11561160
throw new IllegalArgumentException("Bounds out of"
11571161
+ " range: " + newStart + "," +

0 commit comments

Comments
 (0)