Skip to content

Search-and-replace keeps resetting to first result in Jupyter Notebooks #273173

@bernhardbarker

Description

@bernhardbarker

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.105.1 and 1.106.0-insider
  • OS Version: Windows 11 24H2

I have a Jupyter notebook with a bunch of occurrences of a specific word. When I try to replace 1 group of those occurrences, it keeps resetting to first result, making it way too hard to perform said replacement (to the point that it's far easier to just copy that text to somewhere else and replace it there, although that only works when it's in 1 cell).

Intended behaviour:

  1. Put the cursor where you want to start search+replacing from
  2. Press Ctrl+H to open replace dialog
  3. Type in what you want to search for and replace it with
  4. Click "Replace" as many times as desired, to replace subsequent matches

Actual behaviour / steps to reproduce:

  1. Put the cursor where you want to start search+replacing from
  2. Press Ctrl+H to open replace dialog
  3. Search resets to the first match in the notebook
  4. Use "Previous Match" / "Next Match" a bunch of times to get back down to where you want to replace from
  5. Click "Replace" once
  6. Search resets to the first match in the notebook
  7. Use "Previous Match" / "Next Match" a bunch of times to get back down to where you want to replace from
  8. Click "Replace" once
  9. Search resets to the first match in the notebook
  10. And so on

This works properly in a regular Python file, but not in a notebook.

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugnotebook-find

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions