@guy038 said in Search++: A work in progress:
Regarding your point #2You began with :
Mark commands that don’t specify a scope …
Are we agree that you’re speaking about the Mark Before and Mark after options ONLY ? Presently, as you said, these two commands, not restricted to a scope, search throughout all file contents.
It applies to the plain Mark command, too. If there is a non-empty selection (that’s “large enough” per Settings), Mark will perform Mark in Selection (not possible for Mark Before and Mark After). But none of the three will perform Mark […] in Marked Text; that has to be selected explicitly. The same isn’t true for Select; if there is an existing selection (large enough), Select will perform Select in selection. What I was thinking is that perhaps this difference between Mark and Select should be “explained” by having an additional setting for each action, enabled only when Automatically search within {selections | marked text} is checked, that controls whether the matching command is an exception (that is, Select doesn’t perform Selection in Selection, or Mark doesn’t perform Mark in Marked Text). The current behavior would have the “except Select” box unchecked and the “except Mark” box checked.
It comes down to: What do you want to do when you say Select and there’s already a selection, or you say Mark and there’s already marked text? Do you replace the existing selection or marks? add to them? or search within them?
And when I put it that way… I have to think this through some more. From a user’s perspective, the Settings I have are too difficult to figure out. I’m having trouble getting a clear picture of what settings make sense with what other settings and I wrote the damn thing. :-(
Now, as expressed in your very last post, I do support your idea to avoid any command, containing Before or After, that do not include a scope ( in Selection, in marked Text and in Whole Document ). Thus, that should solve automatically this problem ;-))
It would get rid of some of the problem, but not all of it. Where I’m stuck is that I really want there to be “adaptive” commands (the plain Count, Find All, etc.) that recognize when the user would want to search in a selection or in marked text, so they can be the one-click action on a button. Alas, there’s that fundamental design flaw in all computers thus far produced: the RUM (“read user’s mind”) instruction was never implemented. It could be that making an appropriate guess is hopeless. But I really don’t want an oversized, cluttered interface with a matrix of 20 buttons, and I really don’t want users to have to select operations they use often or repeatedly from button menus. So, at least for a while, I’m going to keep trying.
I appreciate your feedback on these issues very much. Anything you, or anyone, can tell me about what works smoothly and what is difficult to use or doesn’t work as expected is helpful.
Now, enter the regex (?si) 1.+?(?=^\R) in the Search dialog
Click on the ▼, after the defeautl Find All option
Run the Mark > Mark in Whole Document option
=> Message : Marked 4 matches
Now, with the (?si) 1.+?(?=^\R) regex still present in the Find dialog
Run the Mark > Mark in Marked Text option
=> We get the message No matches found in marked text. Is this coherent, @coises ?. To my mind, I was expecting the message 4 matches in marked text !
I did document this, but it’s easily missed:
For a regular expression search, each run of marked text is searched independently; the search in any span of marked text cannot “see” outside that span. This affects the behavior of assertions (including word boundaries, lookaheads and lookbehinds, ^ and $).
The search in Columns++ has the same limitation. I couldn’t figure out a practical way to make it work other than this way.
Regarding the Remove marks from all open documents and Remove marks from documents in this view options, in the Tools dialog :
Could you move them to an other place of the Tools dialog, in order to not be close to the Remove marks from active document option, that we’ll probably use more often ?
OR :
Could you add a confirmation dialog for these two specific options ?
I will work out something so they won’t be easily clicked by accident.