Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGayan Perera2021-05-08 17:53:43 +0000
committerMickael Istria2021-06-07 13:45:57 +0000
commit0e5010e86bd35a230fd68999168e717221d357ec (patch)
treec6ed91017148501ca186dcb2d60c4dd843de00d5
parentc00af8e6a2a727052a5674331326c57932040766 (diff)
downloadeclipse.platform.swt-0e5010e86bd35a230fd68999168e717221d357ec.tar.gz
eclipse.platform.swt-0e5010e86bd35a230fd68999168e717221d357ec.tar.xz
eclipse.platform.swt-0e5010e86bd35a230fd68999168e717221d357ec.zip
Bug 573016 - [StyledText] lines are overdrawn on vertical indent change
when vertical indent changes for a line where caret line below the changing line, the lines below must be redrawn to update with the changed indent. At the same time the caret must be updated to follow the changes. Change-Id: I8fe5403c834731a1d4a1f22125d5f109c9f6f5cc Signed-off-by: Gayan Perera <gayanper@gmail.com> Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/180382 Tested-by: Platform Bot <platform-bot@eclipse.org> Reviewed-by: Mickael Istria <mistria@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
index 98bfb39818..14b33adbbd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
@@ -9472,7 +9472,10 @@ public void setLineVerticalIndent(int lineIndex, int verticalLineIndent) {
}
} else {
resetCache(lineIndex, 1);
- if (getCaretLine() >= initialTopIndex && getCaretLine() <= initialBottomIndex) { // caret line with caret mustn't move
+ if((initialTopIndex == 0) && (initialBottomIndex == (content.getLineCount() - 1))) { // not scrollable editor
+ setCaretLocation();
+ redrawLines(lineIndex, getBottomIndex() - lineIndex + 1, true);
+ } else if (getCaretLine() >= initialTopIndex && getCaretLine() <= initialBottomIndex) { // caret line with caret mustn't move
if (getCaretLine() < lineIndex) {
redrawLines(lineIndex, getPartialBottomIndex() - lineIndex + 1, true);
} else {

Back to the top