VSCodeVim / VSCodeVim/Vim

Multi Cursor visual select find/replace only replaces on initial cursor

Open
#9,927 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Describe the bug
When you have multiple cursors and select text with each cursor in visual mode, the :'<,'>s/<old>/<new>/g command only replaces <old> with <new> in the text selected by the initial cursor.

To Reproduce
Steps to reproduce the behavior:

  1. Open a new document
  2. Add the following text
aaaa

bbbaaaabb

xxxaaaabb
  1. Select aaaa
  2. Use gb or ctr | cmd + shift + L to instantiate other cursors selecting other aaaa instances
  3. :'<,'>s/a/n/g
  4. Observe only one instance of aaaa is replaced by nnnn

Expected behavior
All instances of aaaa would be replaced by nnnn

  • Extension (VsCodeVim) version: 1.32.4
  • VSCode version: 1.108.2
  • OS: macos 15.7.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in VSCodeVim 1.32.4 using the sample document, multiple cursors, and the :'<,'>s/a/n/g command. Start by tracing the visual-mode substitution handling and how it receives cursor or selection ranges. Done means the substitution changes every selected aaaa instance to nnnn, rather than only the initial selection.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.