Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2007-10-31 18:58:26 +0000
committerMichael Rennie2007-10-31 18:58:26 +0000
commit627cb61d3a1711d87cbe2aefca5602898abe232a (patch)
tree691f542378ea394ba0e6c76f4817b535a96b6e18 /org.eclipse.ui.console
parent0f4d0ff06e6d42d384deacf3522cd890d14ea16d (diff)
downloadeclipse.platform.debug-627cb61d3a1711d87cbe2aefca5602898abe232a.tar.gz
eclipse.platform.debug-627cb61d3a1711d87cbe2aefca5602898abe232a.tar.xz
eclipse.platform.debug-627cb61d3a1711d87cbe2aefca5602898abe232a.zip
Bug 208084 Error writing to console
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java14
1 files changed, 8 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 c5b18e629..2b00475d4 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,15 +16,17 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.eclipse.swt.custom.TextChangeListener;
+import org.eclipse.swt.custom.TextChangedEvent;
+import org.eclipse.swt.custom.TextChangingEvent;
+
import org.eclipse.core.runtime.Assert;
+
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentAdapter;
import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.swt.custom.TextChangeListener;
-import org.eclipse.swt.custom.TextChangedEvent;
-import org.eclipse.swt.custom.TextChangingEvent;
/**
* Adapts a Console's document to the viewer StyledText widget. Allows proper line
@@ -320,12 +322,12 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4994840
// see bug 84641
int offset = string.length() - 1;
- while (offset >= 0 && string.charAt(offset) == '\r') {
+ while (offset > -1 && string.charAt(offset) == '\r') {
offset--;
count++;
}
- // if offset == 0, the line was all '\r' and there is no string to search for matches (bug 207743)
- if (offset > 0) {
+ // if offset == -1, the line was all '\r' and there is no string to search for matches (bug 207743)
+ if (offset > -1) {
if (offset < (string.length() - 1)) {
string = string.substring(0, offset);
}

Back to the top