Skip to content

Search and replace doesn't scroll to the match when the search term changes #4311

Closed

Description

@AlexAndBear

Initial Checklist

  • I understand this is a bug report and questions should be posted in the Community Discussions
  • I searched issues and couldn’t find anything (or linked relevant results below)

Bug Description

In the text editor's search and replace, changing the search term doesn't scroll to the new current match when its position stays the same (e.g. 1/1 → 1/5), so the match can be far off screen.

Reproduction Steps

  1. Open a long file in the text editor and open "Search and replace"
  2. Search for a word that occurs once near the end, the editor scrolls to it (1/1)
  3. Change the term to a word whose first occurrence is near the top (e.g. 1/5)

Expected Outcome

The editor scrolls to the new current match.

Actual Outcome

The counter shows 1/5, but the view stays where it was and the match is off screen. updateResultState in TextEditorSearchAndReplacePanel.vue only scrolls when the result position changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions