Hi,
It's one month since I initially sent this, and the main developers seem more or less online now, so I'm resending it.
--
On several occasions, we discussed that it would be a good thing to save the find/replace settings. So I wrote it.
Note that when you check "regular expressions", Geany remembers the "case sensitive" state, and restores it when regex is unchecked. This remembered state is not saved, so after restart, you'll get "regular expressions" and "case sensitive" as you see them.
This remembered state was partially wrong, shared between the Find and Replace dialogs (their settings are separate), so I created separate states. Truth to be said, I can't grasp why regex and case are bound like that.
BTW, is there any reason to stash_group_display(fif_prefs) each time the FiF dialog is shown, instead of doing it once on dialog creation? The fif settings won't change between invokations.
On Tue, 22 Feb 2011 19:47:56 +0200, Dimitar wrote:
Hi,
It's one month since I initially sent this, and the main developers seem more or less online now, so I'm resending it.
Haha, this doesn't mean anything, in my case :D.
On several occasions, we discussed that it would be a good thing to save the find/replace settings. So I wrote it.
Note that when you check "regular expressions", Geany remembers the "case sensitive" state, and restores it when regex is unchecked. This remembered state is not saved, so after restart, you'll get "regular expressions" and "case sensitive" as you see them.
This remembered state was partially wrong, shared between the Find and Replace dialogs (their settings are separate), so I created separate states. Truth to be said, I can't grasp why regex and case are bound like that.
I'm not sure too why they are bound so closely but I know they are already for a long time (since sometime 2006, revision 700). Anyway, your patch is committed, thanks a bunch.
I added another small change afterwards which should remain the saved state for 'case sensitive' even if regex is checked. Hope that won't break anything.
BTW, is there any reason to stash_group_display(fif_prefs) each time the FiF dialog is shown, instead of doing it once on dialog creation? The fif settings won't change between invokations.
I guess because of stash_group_update() after the dialog is closed but not completely sure. Nick will know better.
Regards, Enrico
On Sun, 6 Mar 2011 15:53:48 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
Anyway, your patch is committed, thanks a bunch.
I added another small change afterwards which should remain the saved state for 'case sensitive' even if regex is checked. Hope that won't break anything.
Well, it does; the initial stash group display is a bit tricky:
- Case sensitive is restored. - Regexp is restored. If checked, that causes a signal, which remembers the case state.
Your patch ignores this exact signal, so the first-regexp-uncheck- after-restart clears the case instead of leaving it as-is (I tested that to be sure). If we prefer clear-case, it can be done by simply moving the find_case_sensitive setting after find_regexp, as noted in the patch; same for the replace_ settings.
On 7 March 2011 03:12, Dimitar Zhekov dimitar.zhekov@gmail.com wrote:
On Sun, 6 Mar 2011 15:53:48 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
Anyway, your patch is committed, thanks a bunch.
I added another small change afterwards which should remain the saved state for 'case sensitive' even if regex is checked. Hope that won't break anything.
Well, it does; the initial stash group display is a bit tricky:
- Case sensitive is restored.
- Regexp is restored. If checked, that causes a signal, which remembers
the case state.
Your patch ignores this exact signal, so the first-regexp-uncheck- after-restart clears the case instead of leaving it as-is (I tested that to be sure). If we prefer clear-case, it can be done by simply moving the find_case_sensitive setting after find_regexp, as noted in the patch; same for the replace_ settings.
It just occurred to me that the case insensitive setting for regex search and the case insensitive setting for non-regex search are separate settings. I don't know if that is really clear.
One makes the non-regex search case insensitive, the other adds the i modifier to the regex and they don't have to be the same.
But they use the same UI element, which could be considered bad design. Even so they should be saved/restored when the dialog is switched to/from regex and they should both be saved to disk independently.
But I am not sure that the current code achieves this.
Cheers Lex
-- E-gards: Jimmy _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
On 7 March 2011 11:15, Lex Trotman elextr@gmail.com wrote:
On 7 March 2011 03:12, Dimitar Zhekov dimitar.zhekov@gmail.com wrote:
On Sun, 6 Mar 2011 15:53:48 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
Anyway, your patch is committed, thanks a bunch.
I added another small change afterwards which should remain the saved state for 'case sensitive' even if regex is checked. Hope that won't break anything.
Well, it does; the initial stash group display is a bit tricky:
- Case sensitive is restored.
- Regexp is restored. If checked, that causes a signal, which remembers
the case state.
Your patch ignores this exact signal, so the first-regexp-uncheck- after-restart clears the case instead of leaving it as-is (I tested that to be sure). If we prefer clear-case, it can be done by simply moving the find_case_sensitive setting after find_regexp, as noted in the patch; same for the replace_ settings.
It just occurred to me that the case insensitive setting for regex search and the case insensitive setting for non-regex search are separate settings. I don't know if that is really clear.
One makes the non-regex search case insensitive, the other adds the i modifier to the regex and they don't have to be the same.
But they use the same UI element, which could be considered bad design. Even so they should be saved/restored when the dialog is switched to/from regex and they should both be saved to disk independently.
But I am not sure that the current code achieves this.
Cheers Lex
In fact case sensitivity and other settings should also be saved as part of previous searches, so if I pick a previous search from the list I get the right settings too.
Cheers Lex
-- E-gards: Jimmy _______________________________________________ Geany-devel mailing list Geany-devel@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
On Sun, 6 Mar 2011 18:12:25 +0200, Dimitar wrote:
On Sun, 6 Mar 2011 15:53:48 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
Anyway, your patch is committed, thanks a bunch.
I added another small change afterwards which should remain the saved state for 'case sensitive' even if regex is checked. Hope that won't break anything.
Well, it does; the initial stash group display is a bit tricky:
- Case sensitive is restored.
- Regexp is restored. If checked, that causes a signal, which remembers
the case state.
Your patch ignores this exact signal, so the first-regexp-uncheck- after-restart clears the case instead of leaving it as-is (I tested
Yeah. But why should it be left as-is?
This leads again to the question why these two options are bound together so closely. I still don't have an answer, to be honest.
Anyone?
Regards, Enrico
On Tue, 8 Mar 2011 20:22:19 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
On Sun, 6 Mar 2011 18:12:25 +0200, Dimitar wrote:
On Sun, 6 Mar 2011 15:53:48 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
Anyway, your patch is committed, thanks a bunch.
I added another small change afterwards which should remain the saved state for 'case sensitive' even if regex is checked. Hope that won't break anything.
Well, it does; the initial stash group display is a bit tricky: [...]
Your patch ignores this exact signal, so the first-regexp-uncheck- after-restart clears the case instead of leaving it as-is [...]
Yeah. But why should it be left as-is?
Saa... OTOH, why should it be cleared? I realize now that it was my mistake not to follow the Geany logic exactly, no matter how much sense it makes to me.
This leads again to the question why these two options are bound together so closely. I still don't have an answer, to be honest.
Well until then, and since there already is a VISIBLE(dialog) check, and since it's just a few lines, here is a patch that implements the previous case state to the letter, against the current svn.
On Sun, 6 Mar 2011 15:53:48 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
Note that when you check "regular expressions", Geany remembers the "case sensitive" state, and restores it when regex is unchecked. This remembered state is not saved, so after restart, you'll get "regular expressions" and "case sensitive" as you see them.
This remembered state was partially wrong, shared between the Find and Replace dialogs (their settings are separate), so I created separate states. Truth to be said, I can't grasp why regex and case are bound like that.
I'm not sure too why they are bound so closely but I know they are already for a long time (since sometime 2006, revision 700).
The idea was that most regex searches are case-sensitive so it would save time auto-enabling case-sensitive.
Now that the options are saved & restored I've removed this behaviour, as it can be confusing and/or annoying.
Regards, Nick
On Tue, 5 Apr 2011 17:19:29 +0100 Nick Treleaven nick.treleaven@btinternet.com wrote:
On Sun, 6 Mar 2011 15:53:48 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
Note that when you check "regular expressions", Geany remembers the "case sensitive" state, [...]
The idea was that most regex searches are case-sensitive so it would save time auto-enabling case-sensitive.
Now that the options are saved & restored I've removed this behaviour, as it can be confusing and/or annoying.
The last message (from 2011-03-09) from the "save find settings" thread includes a patch that implements this behaviour accross restarts, but I really prefer it removed altogether. So here is a few lines patch that deletes the now useless comment about the stash prefs order, and moves case prefs after regex, as it should be. Case closed. :)
On Tue, 5 Apr 2011 20:13:02 +0300 Dimitar Zhekov dimitar.zhekov@gmail.com wrote:
Note that when you check "regular expressions", Geany remembers the "case sensitive" state, [...]
Now that the options are saved & restored I've removed this behaviour, as it can be confusing and/or annoying.
The last message (from 2011-03-09) from the "save find settings" thread includes a patch that implements this behaviour accross restarts, but I really prefer it removed altogether. So here is a few lines patch that deletes the now useless comment about the stash prefs order, and moves case prefs after regex, as it should be. Case closed. :)
Applied, thanks.
Regards, Nick