Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2007-08-24 19:38:53 +0000
committerDarin Wright2007-08-24 19:38:53 +0000
commit293716021289a6c4187433f1965560dee062263c (patch)
tree5acd44593c0241c2357c2599540195905ab40bfa /org.eclipse.ui.console
parent8b71c7088f825b7f3af421b1c6a7172b38499122 (diff)
downloadeclipse.platform.debug-293716021289a6c4187433f1965560dee062263c.tar.gz
eclipse.platform.debug-293716021289a6c4187433f1965560dee062263c.tar.xz
eclipse.platform.debug-293716021289a6c4187433f1965560dee062263c.zip
Bug 176508 - [console] IOConsole Updater error with long output lines
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java
index e58e518f1..456e834cc 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java
@@ -16,6 +16,7 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
@@ -25,8 +26,6 @@ import org.eclipse.swt.custom.TextChangeListener;
import org.eclipse.swt.custom.TextChangedEvent;
import org.eclipse.swt.custom.TextChangingEvent;
-import org.eclipse.core.runtime.Assert;
-
/**
* Adapts a Console's document to the viewer StyledText widget. Allows proper line
* wrapping of fixed width consoles without having to add line delimiters to the StyledText.
@@ -320,12 +319,14 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
// work around to
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4994840
// see bug 84641
- if (string.endsWith("\r")) { //$NON-NLS-1$
- int len = string.length();
- int index = len >= 2 ? len - 2 : 0;
- string = string.substring(0, index);
+ int offset = string.length() - 1;
+ while (string.charAt(offset) == '\r') {
+ offset--;
count++;
}
+ if (offset < (string.length() - 1)) {
+ string = string.substring(0, offset);
+ }
int lastIndex = 0;
int index = 0;

Back to the top