@guy038 said in Search++: A work in progress:
Now, for any command that cancels all previous selection(s), like the Find in Selection option, the Replace and Find in Selection option and the Find or Replace in Selection option, they seem to act on the whole document, anyway !
Not quite (unless there’s a bug). The first match (meaning first in time) will be the first match (meaning top/left) in the selection for a forward find, or the last match in the selection for a backward find.
After that, the selection is lost. However:
Strictly speaking, to handle properly this case, you should keep a map of the beginning and end of EACH selection, in current document ! Probably not easy with huge documents and a nightmare because of all possible types of selection :-((
That came up in the discussion @Alan-Kilborn and I had when I was working out search in Columns++. Later in that discussion, Alan mentioned the idea of marking text, which became the basis for how search in Columns++ works.
In Search++, there is an option is in the Settings dialog: Convert selections to marked text before beginning a stepwise search. This applies only when you use a stepwise command without a scope specified (default scope); so, if that option is checked, Find when there is a selection (but no marked text) will convert the selection to marked text and search within the marked text, but Find in Selection won’t.
BTW, why the choice between the Replace and Find... options and the Find or Replace... options is not placed in the Settings dialog, like within Notepad++ ? This would simplify some menus !
My thought was that users might change their mind about whether they want to see what the replacement did before moving on; for example, with a complicated regex replacement, perhaps at first wanting to see each replacement in context, then if they seem to be working as expected, start skipping forward to the next candidate for replacement.