fix "Bounds out of range" when outdenting a block of text

This commit is contained in:
Ben Fry
2013-02-03 10:56:23 -05:00
parent ed1c8cca76
commit 063e66eb36
2 changed files with 6 additions and 5 deletions

View File

@@ -1816,7 +1816,8 @@ public abstract class Editor extends JFrame implements RunnerListener {
textarea.setSelectedText(tabString);
} else { // outdent
textarea.select(location, location + tabSize);
int last = Math.min(location + tabSize, textarea.getDocumentLength());
textarea.select(location, last);
// Don't eat code if it's not indented
if (textarea.getSelectedText().equals(tabString)) {
textarea.setSelectedText("");

View File

@@ -57,6 +57,10 @@ X http://code.google.com/p/processing/issues/detail?id=1533
X add to build instructions for OS X:
X ant won't work w/ Java 1.7 until you set JAVA_HOME
X export JAVA_HOME=`/usr/libexec/java_home`
X fix "Bounds out of range" when outdenting a block of text
X Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Bounds out of range: 5374,5376 [5375]
X at processing.app.syntax.JEditTextArea.select(JEditTextArea.java:1214)
X at processing.app.Editor.handleIndentOutdent(Editor.java:1819)
manindra
M bug that was causing the Debugger to point to wrong break point line numbers
@@ -81,10 +85,6 @@ o if sketch was open, then restart by dragging the .pde to p5.app
https://processing-js.lighthouseapp.com/
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Bounds out of range: 5374,5376 [5375]
at processing.app.syntax.JEditTextArea.select(JEditTextArea.java:1214)
at processing.app.Editor.handleIndentOutdent(Editor.java:1819)
_ add Iterator as an import?
_ remove sketch.properties when moving back to the default?