Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
index b84c518ce2..0c4f1853b7 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
@@ -5801,4 +5801,37 @@ public void test_clipboardCarryover() {
String clipboardText = (String) clipboard.getContents(rtfTranfer);
assertTrue("RTF copy failed", clipboardText.length() > 0);
}
+
+/**
+ * Bug 563531 - [regression][StyledText] Scrolling with arrow down key does not update caret painting
+ */
+@Test
+public void test_caretLocationOnArrowMove() {
+ text.setText(
+ "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................");
+
+ shell.open();
+ text.setSize(10, 50);
+
+ for (int i = 0; i < 5; i++) {
+ text.invokeAction(ST.LINE_DOWN);
+ }
+
+ Point caretLocation = text.getCaret().getLocation();
+ int caretOffset = text.getCaretOffset();
+ text.setCaretOffset(0);
+ text.setCaretOffset(caretOffset);
+ assertEquals(text.getCaret().getLocation(), caretLocation);
+}
}

Back to the top