Bug 540448 - [code mining] How to create code minings at the end of the
line
Signed-off-by: angelozerr <angelo.zerr@gmail.com>
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java
index 97975cc..a4907e9 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/InlinedAnnotationDrawingStrategy.java
@@ -163,7 +163,13 @@
annotation.draw(gc, textWidget, offset, length, color, x, y);
int width= annotation.getWidth();
if (width != 0) {
- if (!isEndOfLine) {
+ if (isEndOfLine) {
+ if (!gc.getClipping().contains(x, y)) {
+ // The draw of mining is not inside the gc clipping, redraw the area which contains the mining to draw.
+ Rectangle client= textWidget.getClientArea();
+ textWidget.redraw(x, y, client.width, bounds.height, false);
+ }
+ } else {
// Get size of the character where GlyphMetrics width is added
Point charBounds= gc.stringExtent(s);
int charWidth= charBounds.x;