Find/replace overlay tests: correctly dispatch simulated key events#4194
Merged
HeikoKlare merged 1 commit intoJul 18, 2026
Conversation
OverlayAccess.simulateKeyboardInteractionInFindInputField() simulated a keystroke by notifying listeners on a wrapper widget that internally forwards the event to two different widgets. Since SWT's global event filters react to a dispatched event regardless of which widget triggered it, this caused a single simulated keystroke to be processed twice by anything hooking into such a global filter, such as Eclipse's key-binding dispatch. This currently has no effect, since the overlay's own key handling only relies on a listener attached directly to the actual text control, not on any global event filter. It would, however, cause a command bound to a key sequence through Eclipse's key-binding infrastructure to execute twice per simulated keystroke. With this change, the synthetic event is dispatched directly on the search text control instead, matching how a single real keystroke is delivered. Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
HeikoKlare
marked this pull request as ready for review
July 18, 2026 22:12
Contributor
HeikoKlare
deleted the
findreplace-overlay-fix-double-key-dispatch-in-test
branch
July 18, 2026 23:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
OverlayAccess.simulateKeyboardInteractionInFindInputField()(used byFindReplaceOverlayTest) simulates a keystroke by notifying listeners on a wrapper widget that internally forwards the event to two different widgets. Since SWT's global event filters react to a dispatched event regardless of which widget triggered it, this causes a single simulated keystroke to be processed twice by anything hooking into such a global filter, such as Eclipse's key-binding dispatch.This currently has no observable effect, since the overlay's own key handling only relies on a listener attached directly to the actual text control, not on any global event filter. It would, however, cause a command bound to a key sequence through Eclipse's key-binding infrastructure to execute twice per simulated keystroke — which is exactly the failure mode surfaced by #4192, which moves the overlay onto real Eclipse key bindings.
What changed
The synthetic event is now dispatched directly on the search text control instead of the wrapper, matching how a single real keystroke is delivered.
This has no effect on the current state of
master(theFindReplaceOverlayTestsuite passes unchanged), but is required for the tests to pass correctly on top of #4192.🤖 Generated with Claude Code