From 5e17ae84a2cc46b1a161744810fc1b061ad00d20 Mon Sep 17 00:00:00 2001 From: Shigeru KANEMOTO Date: Wed, 13 Feb 2013 00:18:40 +0900 Subject: [PATCH] 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. --- app/src/processing/app/syntax/JEditTextArea.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/processing/app/syntax/JEditTextArea.java b/app/src/processing/app/syntax/JEditTextArea.java index fae0698cc..8a76a9d33 100644 --- a/app/src/processing/app/syntax/JEditTextArea.java +++ b/app/src/processing/app/syntax/JEditTextArea.java @@ -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 + "," +