Project & Document Regex Searches Behave Differently

V3.1.4.0

Regex: ”\w
Purpose: find closing smart quotes that abut the next word.

e.g. when applied to a project with a document containing: John looked round”What do you mean?” he asked.

Project search will find the document, but will not highlight the match in the editor.
Document search does highlight the match.

I am not seeing either of the described failures. When I run a project search for ”\w with RegEx mode enabled, the intentionally introduced errors in the text are highlighted, and F3 flips between them in the editor.

I did notice one issue that might be causing some of what you are seeing, in that if you press Ctrl+F while a hit is selected it takes the selection as something you want to search for, which makes the text literal rather than sticking with the regex symbols. To use your example, it would become ”W which then cause it to stop finding further examples (unless you have another instance using that letter of course). So long as I leave it closed and just use Shift-F3 and F3 it works well though, and everything stays highlighted.

So I might need more detail in the reproduction notes to see everything as you describe.

Thanks for investigating

I confirm the basic conflict with your finding:

  • Document is found
  • Hit is not highlighted in the editor

New Info!

  • F3 does cycle through the hits in the document, but the highlighting is not the yellow of the search hit… it’s sort of orangey and changes until it turns selection blue
  • The Yellow highlight does appear in a found document if I arrow key the selection point into the word containing the hit… but not if I click on it
  • If I type a new hit target, the hit is highlighted (this is a special case of the above I think).
  • It’s different if there is a space before the open quotes – then the hit does appear highlighted in yellow

(clicked in “What” = no highlight; highlight also occurs there if I arrow key into it)

image

Knowing that F3 cycles between hits and highlights them is sufficient for me; just wanted to record what I had found for the general good.

1 Like

Thanks for the update. Yes, I think most of what you are seeing is expected. Here are some notes:

  • Find highlight and passive project search highlighting are intentionally different colours by default. Feel free to change them in the Appearance: Textual Marks: Colors options tab. The terminology is “Search Results” for passive project search highlighting and “Find Results” for Ctrl+F temporary highlighting.
  • Selection colour is of course a third colour, and given how it works it overlaps all other adornments on the text, so it will hide passive highlights. The result of using Find is to select, so that you can go straight to editing, so after the flashing goes away the selection colour will be what remains.

The screenshot helps, because I always have spell checking turned off, and that seems to be the essential ingredient here in whether the highlight vanishes. So that’s why I was not seeing this happen at all. I’ll get that written up.

Aha. Interaction with spell checking. Makes sense. Glad you have enough info now. :ok_hand:

(I didn’t know about the highlight colour options. It’s not a problem, it was just an unexpected observation :slight_smile: )

Amber, for windows is the Selection color that flashes equivalent to The Find Results alternate highlight in the windows version?

If you try changing it to something very obvious like bright green you should see the intended effect of this setting.

I see the color my question was about the phrasing you used in your explanation

Yes, Find Results Highlight and Find Results Alternate Highlight briefly flash alternately in that order when using Ctrl+F to find each result.