VSCodeVim / VSCodeVim/Vim

d[count]as leaves additional whitespace depending on cursor position

Open
#9,533 0 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
hi i just started vim 2 hours ago so if its on me idk
what ive found is that if you have for example 4 sentences, you put cursor on the middle of sentence 2, then do d2as or 2das it will leave an additional blankspace.

To Reproduce
Steps to reproduce the behavior:

  1. type at least 4 sentences of your preferred language. use . (dot) to signify its a sentence
  2. move to middle of sentence 2
  3. try to delete every subsequent sentences but the last ([count]das) where count is (4) - 2
  4. See two whitespaces

Expected behavior
one whitespace.

Screenshots

Environment:

  • Extension (VsCodeVim) version: 1.29.0
  • VSCode version: 1.98.2
  • OS: windows 11 24h2

Additional context

  1. you can test with only 3 sentences, with cursor in middle of first sentence do d2as. error will happen but its going to be less evident.
  2. expected behavior on vim

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 counted d2as and 2das cases in VSCodeVim using the four-sentence example, with the cursor in the positions described. Then trace the implementation of the d[count]as text-object handling and any related tests; done means deleting subsequent sentences leaves exactly one whitespace, matching Vim behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience
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.