Replace button moves to the next instance but doesn't highlight it

Replace button correctly moves to the next instance but doesn’t highlight it.

It works when using enter to replace (in the replace line).

2 Likes

When I click on ‘next’ during Find&replace, the next search result is always highlighted.

When I click on ‘replace’ during Find&Replace, the current occurrence is replaced, but the next search result is not highlighted.

In this case you have to click ‘previous’ and then ‘next’ to see the next occurrence.

Steps to reproduce

  1. Create a note with text which contains ‘foo’
  2. Start Search&Replace ‘foo’ with ‘bar’
  3. Click ‘replace’
  4. Look for the next occurance of ‘foo’ and it’s not highlighted

Expected result

Highlight next search result after click ‘replace’ for the previous occurrence.

Actual result

Doesn’t highlight the next occurrence after click ‘replace’

Environment

  • Operating system: macOS Big Sur 11.x
  • Obsidian version: v0.12.1 (installer: v0.11.5)

Additional information

1 Like

I’m having the same problem. It’s extremely inconvenient when doing a huge find and replace job. I was just converting one of my 7,500 word stories from third-person to first-person, so I had to replace all the “he”, “him”, “his”, “himself”, etc. It was hundreds of replacements, and I had to go through the document several times with this prev/next attack to find them all … and I still missed some.

The reason the highlight is important is because I don’t want to replace every instance. For example, if it was in dialogue, “He told me about it,” I wouldn’t want to replace that instance of “He” because it’s not referring to the narrator. I need the highlight in order to see the context of the replacement before I click Replace.