From 9892ab9b2621eaa16dc005bdb5fcf250d1dce898 Mon Sep 17 00:00:00 2001 From: Tobias Melcher Date: Sun, 24 Nov 2024 18:15:01 +0100 Subject: [PATCH] don't modify topIndex in handleTextChanged if control has not the focus --- .../common/org/eclipse/swt/custom/StyledText.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.