[Geany] search & replace

Nick Treleaven nick.treleaven at xxxxx
Mon Dec 7 16:51:42 UTC 2009


Late reply...

On Mon, 23 Nov 2009 19:19:47 +0100
spir <denis.spir at free.fr> wrote:

> Here are 3 points to improve (imo) the search & replace tool in geany.
> 
> -1- whole words
> The current "match whole word only" setting fails if the searched expression is not a word at all. What I would expect is that it requires whole word(s) only for the part(s) of the expression that are words -- according to the definition of word characters in the filetype config.
> Meaning that looking for "+" would not fail only because "match whole word only" is checked, because this setting is irrelevant for this expression. Searching for " = name" could succeed with this option set as expected, but fail on " =  names". Am I clear?
> The current behaviour leads to constantly uncheck this option when irrelevant, which may be dangerous for next search & replace, each time we forget to set it back.

I agree it should be implemented.

> -2- record settings
> The common settings we use (for me: escape sequence, case sensitive, whole word only, not close dialog) are not recorded between sessions and cannot be set in preferences. As a consequence, we need to redefine the dialog for each working session -- and again some missing or error may be dangerous. Would it be possibly to add these settings to the "search" frame in preferences?

We could just save the dialog state, probably no need to add global
prefs.

> -3- comments & strings
> A very common task when improving, extending or refactoring code is renaming -- if only for clarity. Too often we'll have to search & replace words that are "key words" for the application, so that they may happen in comments and even in strings. Depending on the case we want the replacement to extend comments and string -- or not at all!
> Unnoticed and unintended replacements commonly lead to funny but meaningless comments or unpredictable issues because of string changes. A pair of settings to address this point would be great.

Could be useful, as Geany already knows these things for most
filetypes. It might be tricky for other filetypes, but even so we could
add this option.

About all 3: clean patches welcome.

Regards,
Nick



More information about the Users mailing list