From 063e66eb3664af4546bbd943dd8331c479326867 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sun, 3 Feb 2013 10:56:23 -0500 Subject: [PATCH] fix "Bounds out of range" when outdenting a block of text --- app/src/processing/app/Editor.java | 3 ++- todo.txt | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 90b50b88b..923045253 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -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(""); diff --git a/todo.txt b/todo.txt index 14c2586e7..8653f2e3c 100644 --- a/todo.txt +++ b/todo.txt @@ -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?