Skip to content

Commit 6f838bb

Browse files
tobias-melcherBeckerWdf
authored andcommitted
Avoid drawing line break characters when rendering code minings
1 parent cf027fd commit 6f838bb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

bundles/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,11 @@ protected static void drawAsLeftOf1stCharacter(LineContentAnnotation annotation,
478478
gc.setForeground(textWidget.getSelectionForeground());
479479
gc.setBackground(textWidget.getSelectionBackground());
480480
}
481-
gc.drawString(hostCharacter, redrawnHostCharX, redrawnHostCharY, true);
481+
String characterToBeDrawn= hostCharacter;
482+
if ("\n".equals(characterToBeDrawn)) { //$NON-NLS-1$
483+
characterToBeDrawn= ""; //$NON-NLS-1$
484+
}
485+
gc.drawString(characterToBeDrawn, redrawnHostCharX, redrawnHostCharY, true);
482486
}
483487
// END TO REMOVE
484488
} else if (style != null && style.metrics != null && style.metrics.width != 0) {
@@ -569,7 +573,11 @@ protected static void drawAsRightOfPreviousCharacter(LineContentAnnotation annot
569573
gc.setForeground(textWidget.getSelectionForeground());
570574
gc.setBackground(textWidget.getSelectionBackground());
571575
}
572-
gc.drawString(Character.toString(hostCharacter), charBounds.x, charBounds.y + verticalDrawingOffset, true);
576+
String characterToBeDrawn= Character.toString(hostCharacter);
577+
if ("\n".equals(characterToBeDrawn)) { //$NON-NLS-1$
578+
characterToBeDrawn= ""; //$NON-NLS-1$
579+
}
580+
gc.drawString(characterToBeDrawn, charBounds.x, charBounds.y + verticalDrawingOffset, true);
573581
// END TO REMOVE
574582
} else if (style != null && style.metrics != null && style.metrics.width != 0) {
575583
// line content annotation had an , reset it

0 commit comments

Comments
 (0)