Quote:
Originally Posted by theducks
I am with you.
Search forward should respect position.
Search Backward should respect position.
Search should Never Wrap as it would negate Start Position (especially with 'All' )
I commonly use S&R to find all AFTER the only one to leave alone.
|
Well who new search was so open to interpretation
I'm with you for 2 1/2 points:
For Current File or All HTML Files:
Search Forward should respect position, always. No wrap is ok as it is, although the option of a dialog to start at beginning (of file/files) would be ok. If it doesn't consistently respect position it will be confusing.
Search Backward should respect position, always
Replace Forward should respect position, always
Replace Backward should respect position, always
But:
Count (All) should count everything in the document(s) irrespective of position. i.e. as if the cursor was at the start.
(Replace) All should replace everything in the document(s) irrespective of position.
Unless I'm missing something, this is how Sigil does Count All, Replace All at the moment. It does not depend on position. I understand the use case for Replace All Forward (e.g. author's names/titles), but then I think a separate Replace Forward button would be needed (or some other dropdown/checkbox option). Count All/Replace All should do just that - ALL, not just some.
Quote:
Originally Posted by user_none
When you do a search the entire document is searched. Every match from beginning to end is then cached. Later searches (if the term or content hasn't changed) reference this cache so the search doesn't have to be run again.
So basically it does a count (entire document) then uses the cursor position to determine which match is closest (forward or backward directional searching). This is instead of starting a new search from the cursor position and ignoring everything before.
|
Ah, that makes sense, at least from an programmer/performance point of view. And it probably only affects Regex as plain text searches (and possibly on certain regexes, maybe even ones no one uses). I'm not sure how that can be explained to a user though. I mean, obviously you just explained it and it is what it is, but I don't know how you could expect a user to figure that out if they come across it: it searches from the cursor, most of the time? Is the performance hit that great in typical usage? Or is this how its usually done and this is a rare unrealistic example? (I just check Libre Office Writer's Find&Replace with regex set and it correctly finds .*hello even if the cursor is not at the start).