VSCodeVim / VSCodeVim/Vim

dd and yy only affect a single line instead of the entire folded

Open
#9,933 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

issue Description
Describe the bug
When a code block is folded, performing a dd (delete) or yy (yank) operation only affects the first line of the fold instead of the entire collapsed block. This breaks the expected behavior where a folded range should be treated as a single entity for editing commands.

To Reproduce

Create a large JavaScript function or object.

Fold the block (e.g., using zc or the editor's fold icon).

Position the cursor on the folded line.

Press dd.

Expected behavior
The entire folded block should be deleted.

Actual behavior
Only the top-level line (e.g., function foo() {) is deleted, leaving the rest of the block's content orphaned and unfolded.

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

Reproduce the issue with a folded JavaScript function or object, using zc or the fold icon, then press dd and yy on the folded line. Trace the fold-aware handling of these editing commands and confirm that the entire collapsed block is treated as one range without leaving its contents orphaned.

Written by the indexing model from the issue text.

Assessment

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