Skip to content

Commit dafceda

Browse files
fix selection color of code mining
1 parent d3dbfd9 commit dafceda

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

bundles/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/ZeroWidthCharactersLineContentCodeMining.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,16 @@ public Point draw(GC gc, StyledText textWidget, Color color, int x, int y) {
7878
}
7979

8080
private Color getColor(StyledText textWidget) {
81+
int off = offset - 1;
8182
Color fg;
8283
boolean isFullSelectionStyle = (textWidget.getStyle() & SWT.FULL_SELECTION) != SWT.NONE;
83-
if (!textWidget.getBlockSelection() && isFullSelectionStyle && isOffsetSelected(textWidget, offset)) {
84+
if (!textWidget.getBlockSelection() && isFullSelectionStyle && isOffsetSelected(textWidget, off)) {
8485
fg = textWidget.getSelectionForeground();
8586
} else {
86-
if (offset < 0 || offset >= textWidget.getCharCount()) {
87+
if (off < 0 || off >= textWidget.getCharCount()) {
8788
fg = textWidget.getForeground();
8889
} else {
89-
StyleRange styleRange = textWidget.getStyleRangeAtOffset(offset);
90+
StyleRange styleRange = textWidget.getStyleRangeAtOffset(off);
9091
if (styleRange == null || styleRange.foreground == null) {
9192
fg = textWidget.getForeground();
9293
} else {

0 commit comments

Comments
 (0)