Replace after paste works against wrong text
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 I copy lines in a buffer, paste them, and then perform a visual ('<,'>) replace, the replacements happen on the original lines, not the pasted ones.
To Reproduce
Steps to reproduce the behavior:
- Visually select lines in a buffer using
shift-V(and optionally movement keys) - Copy the selection with
y - Paste the line(s) elsewhere in the same buffer
- Re-select the pasted line(s) using
shift-Vand press:to enter a command - Run
'<,'>s/old/new/g
The text is replaced in the source lines, not in the pasted lines.
Expected behavior
All occurrences of old are replaced with new in the selection (new pasted text).
Environment (please complete the following information):
- Extension Version:
1.4.0 - OS Version:
Darwin x64 17.7.0 - VSCode version:
1.33.0
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
The issue names no files or tests. First reproduce the visual-select, yank, paste, and range-substitute steps in VSCodeVim, then trace how the selected range is passed to the substitute command. Done means replacing old with new in the pasted lines rather than the original source lines.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100