View Single Post
Old 02-26-2022, 05:07 PM   #49
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,893
Karma: 6120478
Join Date: Nov 2009
Device: many
The issue is that wrap on a current file in a single file search and wrap over a group of files are two very different things.

I had no idea that the order of search ALL HTML files actually matters to anyone, as the very first find that results in a match will become the beginning position for a completely new search and so on with and without wrap. You can easily miss things especially when wrap means two different things here.

To me I want new searches over "all html files" to always follow the same order (depending on direction set - up or down) and always not miss anything without the need for wrap to mean something different. If my target is all files, I want it to cover all files no matter how wrap is set, leaving nothing as missed (guaranteed).

If I actually want to re-run the exact same search over the same set of target files, I want something like a "Restart" button that will actually be tell Sigil to do that and it should only very very *rarely* be needed.

People seem to want to use "All HTML Files" to mean "Remaining HTML Files" even though that makes missing things even more common (with and without the wrap setting). If a search ends in the final file of a search target group, all subsequent searches will fail unless, I change what "wrap" means form wrapping in a file to now be wrapping around a set of files.

And all of this makes it impossible to skip replacements when running individual searches in Saved Search Groups which is how much of the heavy lifting for initial cleanups (especially for things based on scans) is done.

I get it that some people instead want to walk the text chapter by chapter and want to fix things wrong they find in this chapter (and then in all chapters) and then somehow return back to where they started. But that did not even work in earlier Sigil as finding your first match moved you away from your initial position (which in turn made this approach even more fraught for errors of omission). That is why I asked how people got back to where they started even under older Sigil. I still do not understand it.

That said, I can make it so that if nothing is Found in a search, that your file and cursor is restored.

I could even try something like that for Replace All and return you to the same file you started in but actual cursor position may be off if a replacement was made earlier in the current file.

I really do not want to go back to needing "wrap" to mean two different things at two different times and I really want the entire set of search target files to be searched and replaced in the order specified with or without wrap as that is what "All HTML Files" says.

Hope this explains things a bit better.

I just hope we can evolve this into a happy medium for everyone. Right now in current master I can keep position for all Counts and when nothing is found. I could add that for ReplaceAll (at least at the file level).

But perhaps the "Find First" and "Find Next" approach is the way to go in the long run. That is what I was trying to figure out.

Thanks,

KevinH


Quote:
Originally Posted by Turtle91 View Post
I've always thought that the "Wrap" option was pretty intuitive... if you get to the end of the file/group (either Up or Down) it would continue the Find at the beginning of the page/group until it reached the original starting position.

Could this functionality carry over to your new Find/Replace process? Is there a specific reason that Wrap is limited to the current page only??

I will, of course, adjust my brain to whatever method Sigil ends up implementing, but I regularly start searches at my current position and expect to end them at that position without any missed area in whichever file (or group of files) I have selected. If I do NOT want it to search a specific section then I manually clear the "Wrap" checkbox and specify which direction Up/Down I want the search to go and start the search from a specific location.
KevinH is offline   Reply With Quote