search: Fix buffer search history navigation (#37924)

Closes #36109 

Adds an additional option to `search` and `update_matches` to specify
whether the update should affect the search history.

Release Notes:

- Fix navigating buffer search history
4db19a3a96tidely committed on 9/11/2025, 12:55:14 PM· committed by GitHubparentc4e8fe1
4 files changedLine totals unavailable