`:s[ubstitute]` replaces text in a different location
Open
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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