Skip to content

Commit 3850b1b

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 3850b1b

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9315,7 +9315,7 @@ public void setLineVerticalIndent(int lineIndex, int verticalLineIndent) {
93159315
}
93169316
int initialTopPixel = getTopPixel();
93179317
int initialTopIndex = getPartialTopIndex();
9318-
int initialBottomIndex = getPartialBottomIndex();
9318+
int initialBottomIndex = getPartialBottomIndex() + 2 /* include two more additional lines to fix scrolling issue eclipse-platform/eclipse.platform.swt#2512 */;
93199319
int verticalIndentDiff = verticalLineIndent - previousVerticalIndent;
93209320
renderer.setLineVerticalIndent(lineIndex, verticalLineIndent);
93219321
this.hasVerticalIndent = verticalLineIndent != 0 || renderer.hasVerticalIndent();
@@ -9332,8 +9332,8 @@ public void setLineVerticalIndent(int lineIndex, int verticalLineIndent) {
93329332
}
93339333
} else {
93349334
resetCache(lineIndex, 1);
9335-
if((initialTopIndex == 0) && (initialBottomIndex == (content.getLineCount() - 1))) { // not scrollable editor
9336-
setCaretLocations();
9335+
if ((initialTopIndex == 0) && (initialBottomIndex == (content.getLineCount() - 1))) { // not scrollable editor
9336+
setCaretLocations();
93379337
redrawLines(lineIndex, getBottomIndex() - lineIndex + 1, true);
93389338
} else if (getFirstCaretLine() >= initialTopIndex && getFirstCaretLine() <= initialBottomIndex) { // caret line with caret mustn't move
93399339
if (getFirstCaretLine() < lineIndex) {

0 commit comments

Comments
 (0)