Find by formatting not working properly?

I couldn’t find this exact problem, so here is what is happening to me:
So I recently discovered the ‘find by formatting’ function. In particular, I use it to look for codes I added to comments and footnotes (I use them to track some things). The problem is that is not finding everything it’s supposed to.
I will show an example:

So, when I try to find this code, ‘{C. FMC. ORD.}’, it only shows me results that have that code at the top of the comments. For example:

Captura de pantalla 2023-08-17 125248

This doc has no problem, it shows it to me, because the code is at the top. However, when it is not at the top, it does not appear as a result:

Captura de pantalla 2023-08-17 125324

This one I found it myself. In this case, the code is not the top comment, so the search engine doesn’t show it to me as a result.
The same thing happens with all the other codes and comments.

Am I doing something wrong? This function would be very useful to me (specially in cases where I have one code more than once in a document, which I can’t find with only the general ‘project search’), but I can’t seem to make it work properly :sweat:

Thank you :heart:

Hi.
It works fine for me. (?)

You could also use project search instead.

Have you tried searching for your code but without the brackets? Keep it to the minimum of what makes your code unique?

I have been using project search until now, but the problem with doing that when you are looking for something in the comments/footnotes is that it doesn’t tell me where the results are when there is more than one result in a document. And I need to know that. That’s why I tried to use ‘find by formatting’, but for some reason it doesn’t work…
I tried what you suggested (without the brackets) and the same thing happens, it only leads me to those comments that are on top.
I noticed that when there is a comment with the result I’m searching for, if there is another comment below with the same text, then that ‘not top comment’ does appear, but the same doesn’t happen when there is no top comment with that result. This is very strange.

Here is how I do it when I want to search with maximum precision (documents that contain, and where it is within each of them, for all occurrences) :

I have modified my shortcuts greatly, so I won’t bother to mention what the key combinations are, but that shouldn’t matter…

If you do a project search, you will get a list of all the documents that contain what you are looking for.
If you highlight the word(s) you just searched for :
image

and next use this function : Edit/Find/Use selection for find

then these :
image

find next and find previous
will cycle you through all the occurrences within these search result documents.

You have to search those documents one by one though, it won’t move on to the next document when no more occurrences are to be found. The Find… function will simply go back to the start of the document and display a notification saying so.

. . . . . . . .
This said, what you are currently doing should be working.
You shouldn’t have to jump through hoops like that for something as simple as what you are trying to do.
It works for me, Windows, version 3.1.5.1, so that can only mean that there is something odd at your end.

1 Like

[RECTIFICATION (it actually doesn’t work for me neither) :]

Are your comments consecutives in the editor ? Following one another without normal text between them?
Like this :
image

I think I was able to reproduce the bug.
What happens is that when two or more comments are consecutives, and one or more of them has the searched for content, they all get selected in the editor, and therefor acting as if a single one, only once is the find reported.

image

Perhaps your case?


There seems to also be an issue with the “next” button. Sometimes it refuses to go any further. Where the “previous” button cycles on and on forever without any problem.

[EDIT] After changing the order by which my comments containing the target word and the ones without appear in the editor, it is now the “previous” button that won’t work. (I can only suppose that with the proper “configuration/order of comments” across documents, I could make them both stall somewhere mid-project. – Most probably related to the current issue.)
Also: In a comments config of with-without-with, the “previous” button now only finds the last comment, not the first. And the “next” button does exactly as described in the initial post of this thread. (Only the first occurrence is reported, then it skips right off to the next document.)

With this setup I just can’t locate target no. 2 :

Previous finds only the last one.
Next finds only the first.

[/End of experiment]


@AmberV

Thanks for the report. I’ve done some further testing to isolate the triggers and I think the buggy behaviour works out this way:

  • Using Next seems to scan per paragraph within a document, and if the last comment within the paragraph does not contain the search term, the remaining paragraphs in the document are skipped.

  • Using Previous seems to just stop for the document as soon as it hits a comment without the search term (working backward, of course).

  • Adjacent comments (which includes those separated by a return or line break) are, as noted, being handled somewhat like a single comment in terms of the searching; they’ll only be found by Next or Previous if each of the adjacent comments contains the search term; otherwise all are skipped.

Does that cover all the scenarios you’ve seen the Find by Formatting search for the comments failing?

Oh, dear. Thank you all for your answers. I don’t know anything about programming, so I don’t know if that’s it, but that must be what’s going on. I’m sorry, I don’t really know what I need to do :sweat:

Yes, this all happens to me too, though I didn’t do any experiment per se, I just noticed something was off with this function and was just a bit confused… So thank you for doing the experiment!

Also

Thanks a lot for your suggestion. The main problem with that is what you mention: it doesn’t go document by document and, also, I don’t know when there are more than two instances in a document and when there is only one, so I would have to go one by one with all documents. As you can imagine, that is not feasible (I have a lot of documents and codes). That’s why I wanted to use ‘find by formatting’…
That said, I will still do this in the meantime, until this bug is fixed, so thanks again!

Oh, you don’t need to do anything! The comment was just to say that I believe I’ve found the trigger cases that cause the comments to be skipped. I’ll write that up in a bug report for the developer, but I wanted to share so that a) you’d know why some comments seemed to be randomly being missed and b) if you or @Vincent_Vincent (or anyone else who’s run into this) had a case that didn’t fit in with those findings, I could refine the bug notes. But you don’t need to go testing it further at this stage. Didn’t mean to alarm! :smiley:

This can be sped up a bit using shortcuts:

  1. Use the Project Search (in All, for Exact Phrase or whatever is most fitting) to create the search results list of documents containing the term

  2. Load the first document in the editor

  3. The search term is preloaded into the document Find, so you can go straight to using F3 (Find Next) to search through the open document; each instance of the search term is highlighted.

    Since your focus is comments, you may want to load the whole search results collection in Scrivenings mode, then Select All in the comments area and tap the RightArrow key to expand them all. That way when you’re jumping to each instance of the search term, you’ll see the word highlighted rather than just the comment selected, which can be less obvious. (The first comment always starts selected when you load a new document, so if that is also the only comment in the document with the search term, it might look like nothing is coming up when you tap F3—you can know in that case to check that first comment!)

  4. Once the Find Next has looped back to the top of the document, so you’ve found all the matches, use Alt+Shift+DownArrow (Navigate ▸ Open ▸ Next Document) to load the next document in the results list and continue with F3 to find each instance.

1 Like