[LH3475|3497] Inconsistencies when searching

Not sure if this happens with all types of project searches (I think it does), but here’s a concrete example:

  1. I choose RegEx type search and enter b[/b]
  2. Fine, it locates all occurrences of two consecutive spaces and highlights their position in each document.

BUT the search also lists some documents where nothing is highlighted. Nothing in the text, the notes, foot notes, etc. For a moment I thought it had located two spaces in the scene name, but that proved not to be the case.

Am I overlooking something?

This is best described and reproduced with a demo project.

I created a new project from a template and pasted in some random text. No problems there.

It’s hard to recreate the issue when I have no clue what causes it.
I suspect it has something to do with scenes that have, or have had, text in Synopsis or Notes, although when I check these for the scenes that show up in the search, I can’t see any double spaces in them. :frowning:

Perhaps if you can list all the places that are searched? I can then do a manual check inside fields and files to see if I can discover what’s happening.
My criteria are: Search in Project + All/RegEx/Search in Included documents/Search in Excluded documents

You can change ‘ALL’ to Synopsis, Notes, or any other field. That should help you narrow it down.

Gah! Getting dumber by the day. I should have realised that :blush:

I see the issue(s) now.

  1. Sometimes the result of a search is not highlighted. Typically this seems to happen (in my example) if Scrivener wraps the line, e.g.
    some long text{Scrivener wraps here}
    more long text

  2. Search hits are not highlighted for hits outside the main text (e.g. notes) when using type All. This can lead to some confusion

Thanks for your help. Both of these issues have been filed.

Although it works much better than before, there still are a few inconsistencies.

During my last clean-up session, a few documents were listed as having two consecutive spaces in them, but it was impossible to find these inside the documents,

If I remember correctly, I spent quite a bit of time trying to figure out the culprits, including toggling “show invisibles” on.
In the end, I was only able to resolve the issues by cutting all text from the document and then pasting it back as plain text.

Whatever the RegEx search triggered on in those cases, it did not appear to be