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 c0c6c7e1e72..a37328c41ff 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 @@ -6046,7 +6046,7 @@ void handleTextChanged(TextChangedEvent event) { } int firstLine = content.getLineAtOffset(lastTextChangeStart); resetCache(firstLine, 0); - if (!isFixedLineHeight() && topIndex > firstLine) { + if (!isFixedLineHeight() && isFocusControl() && topIndex > firstLine) { topIndex = firstLine; if (topIndex < 0) { // TODO: This logging is in place to determine why topIndex is getting set to negative values.