VSCodeVim / VSCodeVim/Vim

`:s[ubstitute]` replaces text in a different location

Open
#5,289 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

  • VSCode Version: 1.49.1
  • OS Version: Kubuntu 20.04

Steps to Reproduce:

  • Copy a portion of source code
  • Paste the source code right below the original code
  • Select with SHIFT+cursors the just pasted portion of code
  • Try to replace some strings in the text using the ':s' command, this way:

:<,>s/origText/newText/g

The text is replaced in the original code and not in the selected and pasted code
I have attached a small video showing what I mean. For the substitution part, please look at the bottom toolbar.

2020-09-22.06-53-03.zip

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 using the reported copy, paste, visual selection, and :<,>s/origText/newText/g steps. Trace the :s command's handling of visual selections and verify that replacement affects the selected pasted text rather than the original code.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
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.