See issue #2693.
Adds hidden preference 'always_set_from_selected' (default: FALSE) which updates search phrase with selected text when search/replace dialog is reopened. Default behaviour is not changed. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2695
-- Commit Summary --
* Adds hidden preference 'always_set_from_selected' (default: FALSE) which updates search phrase with selected text when search/replace dialog is reopened.
-- File Changes --
M src/keyfile.c (2) M src/search.c (9) M src/search.h (1)
-- Patch Links --
https://github.com/geany/geany/pull/2695.patch https://github.com/geany/geany/pull/2695.diff
Where is the preference set? It should be on the `find` dialog not just read from the config file.
There has been no discussion about it applying to replace.
Needs to be documented in the manual (no it can't be left, it will be forgotten, answering your question from #2693).
Where is the preference set? It should be on the find dialog not just read from the config file.
Since I don't think there is a need to often turn on/off this preference, I don't think we should extend the search/replace dialog with this setting, so I choosed the way of making it a hidden preference. It can be found and easily toggled at _Edit > Preferences > Various_, so there is no need to manually edit any config files.
There has been no discussion about it applying to replace.
I don't think users which want to use this preference want a different behaviour between search/replace, so the setting applies to both of them. However, it would be no problem to make two hidden preferences if needed.
Needs to be documented in the manual (no it can't be left, it will be forgotten, answering your question from #2693).
Okay, then I will create a new PL with the second commit which updates the manual.
We are very much trying to not dump things in `various`, so if its a preference it should be in a normal part of the preferences, probably `editor->features` which has plenty of room.
Don't make a new PR, just push changes to this one.
We are very much trying to not dump things in various...
For what it's worth, this is not shared by _all_ core developers; personally I feel that the Preferences dialog already has loads of options and that it's better for preferences that are obscure or rarely used to be dumped into the `Various` preferences tab. In any case, I don't feel strongly, I just mention so it's clear this is not some kind of agreed upon policy. IMO, leave it to the person willing to make the PR, it can always be moved later if it turns out people are using it a lot for some reason or having trouble finding it.
IMO, leave it to the person willing to make the PR, it can always be moved later if it turns out people are using it a lot for some reason or having trouble finding it.
Sure, but if we don't ask we don't know if the OP is happy to do it.
Seems there may have been a misunderstanding, I was saying that there needs to be an option if the search is automatically updated on selection, not if it requires user action like pressing ctrl-f.
The name of the option `always_set_from_selected` suggested it was automatic, but having had a chance to look at the PR code it appears to only happen on ctrl-f (or whatever the search shortcut is set to).
If @etkaar confirms thats the case then I agree with @codebrainz it doesn't need an option, just mentioning in the manual.
@etkaar also just noticed you made the changes in master, not in a branch, when you update can you please make the changes in a branch, that way committers can switch back from your changes to master or another set of changes easily.
The name of the option always_set_from_selected suggested it was automatic, but having had a chance to look at the PR code it appears to only happen on ctrl-f (or whatever the search shortcut is set to).
Correct, the update of "Search phrase:" with the selected text only happens on the "reopen" event of the already visible dialog initiated by using the shortcut or menu _Search > Find..._ or _Search > Replace..._
@etkaar also just noticed you made the changes in master, not in a branch, when you update can you please make the changes in a branch, that way committers can switch back from your changes to master or another set of changes easily.
Thanks for the note, I will try that!
@etkaar pushed 0 commits.
Closed #2695.
@elextr Short question: How do I update the docs? By manually editing both _geany.txt_ and _geany.html_ or is there a another way?
@etkaar did you make your query about the docs on a commit that you have now deleted?
Anyway, edit `geany.txt`, `geany.html` is generated from it by rest2html but is kept in the repository so its available to repository (and tarball) users without needing rest2html. It would be appreciated if you could re-generate it, but its not required, but of course that adds to the mergers work and likely slows the merge.
@elextr Yes, the next time I should better use <strike>Comment</strike> and not delete it. I deleted it because I in the meanwhile found out that _geany.html_ is automatically updated when I edit _geany.txt_. I made a new Pull Request (#2697) and think now all is correct (but the .html is not transferred to GitHub because it is not part of the GitHub repository).
(but the .html is not transferred to GitHub because it is not part of the GitHub repository).
Ahh yeah, you are right, we took it out, so only the `geany.txt` is needed.
github-comments@lists.geany.org