summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java8
1 files changed, 8 insertions, 0 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 41a9db9c76..041e97386c 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
@@ -7794,6 +7794,14 @@ void reset() {
if (horizontalBar != null) {
horizontalBar.setSelection(0);
}
+ if (ime != null) {
+ String text = ime.getText();
+ if (text != null && text.length() > 0 && ime.getCompositionOffset() != -1) {
+ ime.setCompositionOffset(0);
+ content.replaceTextRange(0, 0, text);
+ setCaretOffset(ime.getCaretOffset(), SWT.DEFAULT);
+ }
+ }
resetCache(0, 0);
setCaretLocation();
super.redraw();