VSCodeVim / VSCodeVim/Vim

Actions should all have a failed property that is set when there's a failure in execution (like BaseMotion)

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

Nobody has claimed this yet.

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

Description

Describe the bug
If you press 'j' at the end of a file or press 'w' at the last word of a file, the movement should fail and return a failed IMovement to stop any Macros (or remappings) from continuing.

To Reproduce
Steps to reproduce the behavior:

  1. Create file with 2 lines with a single word
  2. Press 'gg'
  3. Create macro like this 'qqA;jq'
  4. Call the macro like this '5@q'
  5. The result is:
word;
word;;;;;

Expected behavior
The macro should stop when you press 'j' on the last line and the result should be:

word;
word;

Additional context
This behavior is correct for motions like fFtT% from what I've seen, but it should be extended to all motion types.

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 tracing how motion actions report failure to macro and remapping execution, using BaseMotion as the reference mentioned in the issue. Reproduce the two-line example and inspect the motion implementations involved in j and w. Done means all motion types report execution failure consistently and the macro stops before adding extra semicolons.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.