VSCodeVim / VSCodeVim/Vim

Different behavior recording vs executing macros

Open
#2,613 3 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is this a BUG REPORT or FEATURE REQUEST? : Bug

What happened:

When recording macros, the behavior of the command w is different during recording than it is during execution. For instance, if you have a string and want to jump to the beginning of the word, during recording you have to press w twice to jump to the ' and then the beginning of the word. However, during execution the first time w fires the cursor goes straight to the beginning of the word, so the second recorded w will move the cursor to the next word and throw the entire sequence out of position.

How to reproduce it:

start with [ 'string', ] and cursor at the beginning

  1. qa
  2. w (cursor moves to ')
  3. w (cursor moves to s)
  4. yw w l l p
  5. q

during recording that yields ['string', string], but when you call it with @a it yields [ 'ststringring', ]

I think the problem is the ' character. When the example above executes, the w commands in steps 2 and 4 don't jump the cursor to ' like they do during recording.

Environment:

  • Extension (VsCodeVim) version: 0.11.5
  • VSCode version: 1.22.2
  • OS version: OSX 10.11.6

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

Start by reproducing the reported macro sequence in VSCodeVim 0.11.5 on the shown input, comparing recording and execution of the w motions around the apostrophe. Trace the macro recording and replay entry points to identify why motion behavior differs; done means the recorded sequence produces the same result during replay.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.