-
Notifications
You must be signed in to change notification settings - Fork 190
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
FindReplaceOverlay: Add "skip replace" button #2507
base: master
Are you sure you want to change the base?
Conversation
support the workflow in which a user selectively wants to replace multiple occurrences but needs to check first which to replace. Adds a button associated to a shortcut which - when triggered - simply jumps to the next occurrence of the search term.
@stephan-herrmann you proposed this in #2473. |
I have to admit that I am not in favor of the proposed change. This is because the solution does not address the essence of the actual issue. The solution adds another button (to a user interface that is/was supposed to be lean), while there is already a button doing exactly the same thing. If I understand correctly, it is just there to provide an additional keyboard shortcut. Would it, e.g., be better to adapt the shortcuts assigned to the existing buttons depending on which of the input fields has foucs? I am not completely convinced that that's a perfect solution (as I see changing shortcuts as conflicting to good UX in terms of expectability), but since the meaning of shortcuts is context dependent already now ("Enter" does different things depending on whether the find or replace input field has focus), that might be a reasonable alternative. Note that the shortcut currently assigned to the new button has no effect on Windows (at least in my development SDK). |
Sorry for late reply. Rethinking, I agree with @HeikoKlare that not a new button is needed, but some change to keybindings. @HeikoKlare you mentioned Ctrl+K for find next, since which version is this implemented? (doesn't work for me in 2024-09, as long as the overlay is shown). Actually without consulting any "manual" I would expect one of these: F3 (like in several other applications, but already used for "Find Declaration") or repeated Ctrl+F (already used for hiding the overlay, but that's redundant with Esc, right?). |
@HeikoKlare I agree with you that adding this button is "awkward". I feel like changing keybindings when the input field is switched might be confusing (this retakes us to the "which bar is active right now?" question) I tend to gravitate towards @stephan-herrmann 's new idea of having one "power-button" which always performs a search, no matter where you are in the find/replace dialog. Ctrl+F is the logical choice. I will implement a demo when I have slightly more time |
Having a general button performing a search sounds reasonable to me. In my opinion, the natural choice for this would be whatever shortcut is bound to the "Find Next" action. Usually, that is bound to CTRL+K. @stephan-herrmann that action has been there for quite a while, but currently it is not accessible from within the overlay. An option could be to just provide this action from within the overlay. Currently it is automatically deactivated when opening the overlay together with many other shortcuts that you do not want to trigger for the editor from within the overlay (such as deleting a line).
Note that this is kind of already given right now: the shortcuts ENTER and CTRL+ENTER are bound to different actions, depending on whether the find or replace input field has focus. So that would actually not be different.
Please do not use the CTRL+F shortcut for this. That shortcut is already bound in every situation: it opens the overlay, when the find input field has focus, it closes the overlay, and when anything else has focus (in particular the replace input field) it moves focus to the find input field. So using it to search when the replace input field has focus does not work without breaking existing (and in my opinion reasonable) behavior. In addition, it would further overload that shortcut, making it hard to comprehend how it behaves in different situation. |
support the workflow in which a user selectively wants to replace multiple occurrences but needs to check first which to replace. Adds a button associated to a shortcut which - when triggered - simply jumps to the next occurrence of the search term.
This PR is a test to see whether this is something that adds user value. Adding this button is slightly awkward since it does exactly the same thing as "find next" - except that it can be reached by shortcut (Ctrl+Shift+O) from the Replace bar.
If this PR is approved (help wanted!), these are the next steps: