Skip to content

Commit 6148681

Browse files
StyledText#setLineVerticalIndent: fix overlapping code minings in editor
Ensure problem annotation code minings are rendered below source lines to prevent visual overlap during vertical scrolling. Fixes: #2512
1 parent 508ad4a commit 6148681

File tree

1 file changed

+18
-19
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom

1 file changed

+18
-19
lines changed

bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9330,27 +9330,26 @@ public void setLineVerticalIndent(int lineIndex, int verticalLineIndent) {
93309330
if (verticalScrollbar != null) {
93319331
verticalScrollbar.setMaximum(verticalScrollbar.getMaximum() + verticalIndentDiff);
93329332
}
9333-
} else {
9334-
resetCache(lineIndex, 1);
9335-
if((initialTopIndex == 0) && (initialBottomIndex == (content.getLineCount() - 1))) { // not scrollable editor
9336-
setCaretLocations();
9337-
redrawLines(lineIndex, getBottomIndex() - lineIndex + 1, true);
9338-
} else if (getFirstCaretLine() >= initialTopIndex && getFirstCaretLine() <= initialBottomIndex) { // caret line with caret mustn't move
9339-
if (getFirstCaretLine() < lineIndex) {
9340-
redrawLines(lineIndex, getPartialBottomIndex() - lineIndex + 1, true);
9341-
} else {
9342-
setTopPixel(initialTopPixel + verticalIndentDiff);
9343-
}
9344-
} else { // move as few lines as possible
9345-
if (lineIndex - getTopIndex() < getBottomIndex() - lineIndex) {
9346-
setTopPixel(initialTopPixel + verticalIndentDiff);
9347-
} else {
9348-
// redraw below
9349-
redrawLines(lineIndex, getPartialBottomIndex() - lineIndex + 1, true);
9350-
}
9333+
}
9334+
resetCache(lineIndex, 1);
9335+
if ((initialTopIndex == 0) && (initialBottomIndex == (content.getLineCount() - 1))) { // not scrollable editor
9336+
setCaretLocations();
9337+
redrawLines(lineIndex, getBottomIndex() - lineIndex + 1, true);
9338+
} else if (getFirstCaretLine() >= initialTopIndex && getFirstCaretLine() <= initialBottomIndex) { // caret line with caret mustn't move
9339+
if (getFirstCaretLine() < lineIndex) {
9340+
redrawLines(lineIndex, getPartialBottomIndex() - lineIndex + 1, true);
9341+
} else {
9342+
setTopPixel(initialTopPixel + verticalIndentDiff);
9343+
}
9344+
} else { // move as few lines as possible
9345+
if (lineIndex - getTopIndex() < getBottomIndex() - lineIndex) {
9346+
setTopPixel(initialTopPixel + verticalIndentDiff);
9347+
} else {
9348+
// redraw below
9349+
redrawLines(lineIndex, getPartialBottomIndex() - lineIndex + 1, true);
93519350
}
9352-
setScrollBars(true);
93539351
}
9352+
setScrollBars(true);
93549353
}
93559354

93569355
/**

0 commit comments

Comments
 (0)