If you do: ctrl-f you get a nice search popup in writer, that is lovely ...
As all right thinking people know, ctrl-g should give you the next search hit :-) but this doesn't work ...
The code for this lurks in:
If we want to hard-code the keybindings, we could perhaps do that by hooking into the PreNotify method, might work nicely.
An ideal solution would also add a "case-sensitive" check-box to the toolbar, and (in a nutshell) make it as sexy as the mozilla one - but perhaps that should be a separate easy hack.
Thanks ! :-)
Created attachment 57606 [details]
add ctrl-g to re-search
Addendum to my attachment (because I apparently don't know how to use bugzilla). This is my first attempt at contributing to libreoffice so it might not be the ideal solution, but it appears to work.
Ooh - looks nice ! :-)
Any chance of a reverse search ? I forget what the binding is for that ?
Otherwise will merge Monday ... Thanks !
ctrl-shift-g is the sequence to search backwards. The code that searches when you hit enter already had a condition in it to search backwards when you hold shift. Since I only added on to the if statement surrounding that code, you get ctrl-shift-g to search backwards for free.
There is one possible problem, however. When you change the direction you are searching, the first input is ignored. For example, if you try to advance forward, reverse, reverse, the first reverse will be ignored. This applies to using enter/ctrl-g as well as the up and down arrow buttons on the search popup. I don't know if this is a bug or desired behavior, but it seems inconsistent with other applications.
In the event that it is considered a bug, I've started looking in to how to change it. Also working on the case-sensitive check box you asked for.
Hi Paul - silly me, thanks for the explanation (and the nice patch) :-)
Any chance you can mail the developers list email@example.com with an MPL/LGPLv3+ license statement, and link yourself into here:
Pushed it to master, will be in 3.6 - thanks !
Cameron Paul committed a patch related to this issue.
It has been pushed to "master":
fdo#46438 - add ctrl-g / ctrl-shift-g binding for find again fwd/back
Cameron: This is great, thanks a lot for the patch! Unfortunately it may conflict with Ctrl-g in other locales than en-US; would you be able to update your patch so that instead of hardcoding it in svx/source/tbxctrls/tbunosearchcontrollers.cxx, you'd change:
1) you remove .uno:RepeatSearch from "F_SHIFT_MOD1", and instead use
in <node oor:name="G_MOD1" oor:op="replace">
2) actually, to implement also the search backward, I'd try to change the '.uno:RepeatSearch' to '.uno:DownSearch', and also introduce G_SHIFT_MOD1 that would be bound to '.uno:UpSearch'
Can you please try that? Thank you a lot!
[I am reopening this bug so that we can track this, but your patch is already in, and will be in the release, unless you can dive into the above mentioned config, and move the fix there :-)]
I should be able to take care of that. Thanks for providing the pointers on how to improve this.
After doing a little testing it seems your suggestions might not work (At least not on linux, I can't say for sure on other systems). The shortcuts defined in Accelerators.xcu seem to only apply when the document is selected. When a text field in a toolbar is selected, they have no effect. This means when the find bar has focus ctrl-g would be ignored.
If the toolbars are eating key events as I suspect they are, then ctrl-g will be ignored anyway when the find bar is selected and the hard coded solution wouldn't interfere with anything defined in Accelerators.xcu. Unfortunately I can't guarantee that is consistent behavior.
lets close this out then to tidy up - thanks Cameron :-)
For a record, Jan Holesovsky added F3 for find next as well. (and of course Shift+F3 still do find previous)
*** Bug 36887 has been marked as a duplicate of this bug. ***
Migrating Whiteboard tags to Keywords: (EasyHack,DifficultyInteresting,SkillCpp,TopicCleanup )