GNOME Bugzilla – Bug 749117
Change behavior of CTRL+F to match firefox, chrome, sublime text ...
Last modified: 2015-05-09 19:52:51 UTC
I know this might be controversial, and GEdit is the same. But my (and I suppose most people's) muscle memory adapted to the CTRL+F behavior of many other tools. I.e. Enter -> next search entry (Tab + Enter prev search results) ESC -> remove focus and hide search box again I think that combination is much better, as on many notebooks the enter key is prominent and big, while the arrow keys are quite small and also harder to reach. I think it would be good to adapt that as default behavior as so many other editors have it (jetbrains, sublime text ... ) and have an option (maybe hidden in gsettings) to revert to the GEdit style of searching.
Created attachment 303118 [details] [review] Patch for CTRL+F behavior I have created a patch with my desired behavior of ctrl+f. it also contains additional functionality for remembering the previous search as well as automatically adding the currently selected string if something is selected to the search entry. PS. I don't know if I need to free the previous_search_string somewhere? Not a C/glib pro ...
Just realized that I wrote 'Tab+Enter' but actually meant 'Shift + Enter' of course.
I've pushed this with some followup up commits which address the leaks, style, and ensuring we scroll back to the insert mark when refocusing the view. I can't guarantee that behavior will stay like this forever (we need to do a bunch of iteration on search), but this is clearly better than what we had. Thanks!
That's really cool! I just realized another small issue: After searching and pressing enter + escape, the cursor is at the beginning of the search match. I think it would be best if the match is selected and the cursor at the end of the selection. Cheers, Wolf