VSCodeVim / VSCodeVim/Vim

There is a bug in the paste and mark commands when using macros

Open
#9,156 2 comments 0 reactions 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

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:

  1. Please copy the following text to your VSC.
line 1 **********
line 2 **********
line 3 **********

paste line ******
paste line ******
  1. Use 2yy command to yank the paste line ******.
  2. Move your cursor to the line 1 **********.
  3. Please type qapmaq in normal mode.
  4. 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 ******
  1. Please move your cursor to the line 2 **********, and type @a to play marco.

  2. 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 ******
  1. 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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.