Skip to content

[Find/Replace dialog][Linux] "Replace" buttons remain disabled when using "Enter" #2880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 of 4 tasks
fedejeanne opened this issue Apr 1, 2025 · 3 comments · Fixed by #2882
Closed
3 of 4 tasks
Assignees
Labels
bug Something isn't working regression
Milestone

Comments

@fedejeanne
Copy link
Contributor

fedejeanne commented Apr 1, 2025

Let's make sure issue is not already fixed in latest builds first.

Steps to reproduce

Same as https://bugs.eclipse.org/bugs/show_bug.cgi?id=410603

On Linux

  • Open a file
  • Make sure no text is selected
  • Open the "old" search dialog (Ctrl + f)
  • Search for something that is in the file
  • Hit Enter --> The "replace" buttons remain disabled.

When using the mouse to click the "Find" button, everything works as expected.

Reproducible on

  • Windows
  • Linux
  • Mac (??? not tested)

Considerations

I was made aware of the bug when working on another PR (see #2876 (comment)) but it turns out that my PR did not cause it so reverting the mentioned changes (see #2879) doesn't fix it (maybe that PR is part of the fix but it's not the complete fix).

Community

  • I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.

Disclaimer

I can't work on this right now so I'm adding the tag "help wanted". Feel free to jump in.

@iloveeclipse
Copy link
Member

Search for something that is in the file

"Replace" is always enabled for me following the steps above.

What is missing and is a precondition for the bug:

If nothing is selected in the editor and Ctrl+F is used to open search dialog, "Replace" button remains disabled if hitting "Enter" key.

Note: only if "Find" button is used and something is found & selected in the editor, "Replace" button will be enabled.

So Enter key listener seem to invoke the "find next" functionality but misses to update "Replace" button state.

@fedejeanne
Copy link
Contributor Author

I updated the description, thank you

@iloveeclipse
Copy link
Member

On Enter the "Replace" button is properly updated for the first time,
called from

but it is immediately disabled via call from

updateButtonState(!findReplaceLogic.isActive(SearchOptions.INCREMENTAL));

via this stack

Thread [main] (Suspended)	
	FindReplaceDialog.updateButtonState(boolean) line: 1104	
	FindReplaceDialog.lambda$1() line: 649	
	Lambda.run() line: not available [local variables unavailable]	
	FindReplaceDialog$InputModifyListener.modifyText(ModifyEvent) line: 147	
	TypedListener.handleEvent(Event) line: 217	
	EventTable.sendEvent(Event) line: 91	
	Display.sendEvent(EventTable, Event) line: 5864	
	Combo(Widget).sendEvent(Event) line: 1652	
	Display.runDeferredEvents() line: 5074	
	Display.readAndDispatch() line: 4524	

What makes me wonder why do we have two calls to modificationHandler.run() from modifyText()?

The first call seem to be unneeded:

I've created PR: #2882

HeikoKlare pushed a commit to iloveeclipse/eclipse.platform.ui that referenced this issue Apr 4, 2025
HeikoKlare pushed a commit to iloveeclipse/eclipse.platform.ui that referenced this issue Apr 4, 2025
@iloveeclipse iloveeclipse removed the help wanted Extra attention is needed label Apr 14, 2025
@iloveeclipse iloveeclipse added this to the 4.36 M2 milestone Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression
Projects
None yet
3 participants