VSCodeVim / VSCodeVim/Vim

`j` and `k` ignore folded lines

Open
#5,722 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
If you have a folded block of code and you do, for example, 4j, it will move 4 visual lines, ignoring the folded lines, which makes relative line numbers unreliable, as they do take into consideration folded code.

To Reproduce
Steps to reproduce the behavior:

  1. With relative line numbers on
  2. Fold a block of code
  3. Try moving up or down to a line passing the folded block of code with motion k or motion j

Expected behavior
It should take into consideration folded code.

Screenshots
85zz17orwi
In this example, I've pressed 26 j , it should've moved to the empty line before cin.get();
Instead, it move 26 visual lines, ignoring the folded code inside GetBiggestNumber()

Environment (please complete the following information):

  • Extension Version: 1.17.1
  • OS Version: Windows_NT x64 10.0.18363
  • VSCode version: 1.51.1
    Additional context

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 issue in VS Code with relative line numbers, a folded block, and a counted j or k motion. Trace the j/k motion handling and how folded lines are counted, then verify that movement and relative line numbers agree across folded regions. Done means counted motions include folded lines and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

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