Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2012-10-25 16:17:39 +0000
committerMarkus Keller2012-10-25 16:17:39 +0000
commit46ac49f4848a639b0bdb8ac029b6debd9b9c367d (patch)
tree2daeefdf8b452c4d3103b08a56d64e9fe1ef3eab
parent05be2519c00be901ef1067b044790fa07dc9871e (diff)
downloadeclipse.platform.debug-46ac49f4848a639b0bdb8ac029b6debd9b9c367d.tar.gz
eclipse.platform.debug-46ac49f4848a639b0bdb8ac029b6debd9b9c367d.tar.xz
eclipse.platform.debug-46ac49f4848a639b0bdb8ac029b6debd9b9c367d.zip
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java30
1 files changed, 25 insertions, 5 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
index 6dfe43554..cccb9b61b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
@@ -99,15 +99,35 @@ public class ProcessPropertyPage extends PropertyPage {
if (count > 1) {
// render as one argument per line, but don't copy line delimiters to clipboard:
final int[] segments = new int[count - 1];
- final char[] chars = new char[count - 1];
- Arrays.fill(chars, '\n');
-
commandLineText = DebugPlugin.renderArguments(arguments, segments);
styledText.addBidiSegmentListener(new BidiSegmentListener() {
public void lineGetSegments(BidiSegmentEvent event) {
- event.segments = segments;
- event.segmentsChars = chars;
+ int offset = event.lineOffset;
+ int end = offset + event.lineText.length();
+
+ // extract segments for the current line:
+ int iStart = Arrays.binarySearch(segments, offset);
+ if (iStart < 0) {
+ iStart = -iStart - 1;
+ }
+ int i = iStart;
+ while (i < segments.length && segments[i] < end) {
+ i++;
+ }
+ int n = i - iStart;
+ if (n > 0) {
+ if (n == segments.length) {
+ event.segments = segments;
+ } else {
+ int[] lineSegments = new int[n];
+ System.arraycopy(segments, iStart, lineSegments, 0, n);
+ event.segments = lineSegments;
+ }
+ final char[] chars = new char[n];
+ Arrays.fill(chars, '\n');
+ event.segmentsChars = chars;
+ }
}
});
}

Back to the top