VSCodeVim / VSCodeVim/Vim

Macro from visual selection forgets last character

Open
#3,026 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
When replaying a macro from a visual selection, the macro gets replayed as if the last character of the selection was not selected.

To Reproduce
Steps to reproduce the behavior:

  1. Use a line with the content lorem ipsum
  2. Visually select lorem
  3. Record a macro to the register q by pressing qqca<ESC>q. lorem should be replaced by a
  4. Visually select ipsum
  5. Replay the macro by pressing @q. ipsum should be replaced by a but is replaced by am.

Expected behavior
A replay on the complete selection is expected. However, the last character of the selection is not considered for the selection.

Screenshots
(I hope that the description is sufficient. I will add screenshots if necessary.)

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 0.16.2
  • VSCode version: 1.26.1
  • OS: Darwin x64 17.7.0

Additional context
I use the following extension settings:

    "vim.enableNeovim": true,
    "vim.foldfix": true,
    "vim.hlsearch": true,
    "vim.leader": " ",
    "vim.normalModeKeyBindingsNonRecursive": [
        { "before": [ "j" ], "after": [ "g", "j" ] },
        { "before": [ "k" ], "after": [ "g", "k" ] }
    ],
    "vim.sneak": true,
    "vim.visualstar": true,

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

No source file, test, or entry point is named. First reproduce the reported macro sequence in VSCodeVim with visual selections, then trace the visual-selection and macro-replay handling. Done means replaying the macro replaces the complete ipsum selection with a rather than leaving its final character.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.