On Sat, 2009 Jan 17 16:33:11 +0100, Enrico Tröger wrote:
I wrote this in another mail in this thread, one/the reason for the arrow was to simplify the dialog. But based on the feedback in this thread, we will remove it.
Placing a "Replace All" GtkFrame around them might address potential user confusion... grouping the buttons together in the same way that the arrow currently does, but without hiding anything.
Alternately, just to toss in another idea, NEdit uses a label at the left such that the button labels complete a sentence. Something like
Replace all in: [Session] [Document] [Selection]
(Which would nicely eliminate the redundant "In" preposition on each of the buttons.)
-3- I would add a "replace all in current scope" function that I dream of for years already ;-) where 'scope' means closest nesting func, class, or whatever.
Hmm, not sure. Could be done but adds yet another button, yet another thing you need to sort out when you do a quick search/replace. (this is not a 'no', just a 'I won't work on it')
-4-This button and "in selection" should be invalid (greyed) whenever there is no 'scope' (module toplevel, meaning "in scope" = "in doc") or there is no selection.
Yes, this is a good idea (at least for selection).
Agree on greying out "In Selection" when there is no selection. "In Scope" sounds interesting, but I think it would be too complicated practically to be added alongside the other find/replace modes. My misgivings:
1. Would it work reliably/predictably, even in cases of complex C++ code and the like?
2. What, exactly, does "scope" mean? Body of the current function/method? (Would it include the signature line, so you can find/replace the formal parameters too?) What about just the current curly-brace block, which would also have a claim to the term "scope?" Or the current class? Would there be a preference to decide between these, or would it be something set by the language syntax driver?
-6- I'd love an '\i' code working in both the search & replace fields, that would mean 'indent' & match the user specified value for one level of indentation in preferences (that is n spaces or one tab).
Use regular expressions like "^[ \t] .*" or something similar, I usually fail to construct untested regexps :).
Yeah, for cases like this I'd do e.g. s/^(\s*)foobaz/\1barqux/. There might be some value to \i if you're changing indent levels, but Geany already has such an excellent keybinding for this (Tab or Shift-Tab with a selection) that I would say a new regex escape is not needed.
--Daniel