There is a bug in the paste and mark commands when using macros
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
If I use yy command to yank some lines,
then I use p(paste) and m(mark) commands in macro, such as pma.
When I play marco, the mark a will be set at the end of next line of paste content.
To Reproduce
Steps to reproduce the behavior:
- Please copy the following text to your VSC.
line 1 **********
line 2 **********
line 3 **********
paste line ******
paste line ******
- Use
2yycommand to yank thepaste line ******. - Move your cursor to the
line 1 **********. - Please type
qapmaqin normal mode. - The text will become like this, type `a,
the cursor will jump to the beginning of paste content.
This is correct situation.
line 1 **********
paste line ****** <-- Mark a at beginning of this line.
paste line ******
line 2 **********
line 3 **********
paste line ******
paste line ******
-
Please move your cursor to the
line 2 **********, and type@ato play marco. -
The text will become like this, type `a,
the cursor will jump to the end of
line 3 **********,
line 1 **********
paste line ******
paste line ******
line 2 **********
paste line ******
paste line ******
line 3 ********** <-- Mark a at end of this line.
paste line ******
paste line ******
- I test this procedure in Vim and VsVim, they don't exist this problem.
And I invite my friend to test this bug in his VSC, he can reproduce it.
Environment (please complete the following information):
- Extension (VsCodeVim) version: 12.7.3
- VSCode version: 1.91.1
- OS: Windows 11
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
First reproduce the issue using the documented normal-mode sequence, focusing on macro playback with paste and mark commands. Trace the macro, paste, and mark command entry points, then verify that replaying @a places mark a at the start of the pasted content as in the direct command sequence.
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