VSCodeVim / VSCodeVim/Vim

`<C-t>` does not move the cursor after the first indent

Open
#7,204 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
<C-t> indents a line. But if you use it more than once (e.g. indenting deeply in some Python code), after the first indent the cursor stops moving while spaces are still inserted after the cursor.

It also seems to move the cursor back by one space.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a new line.
  2. Press <C-t> twice.
  3. See how the cursor is indented one level while there's another level of indent worth of spaces preceding the cursor.

Expected behavior
The cursor to always stay ahead of the inserted spaces.

Screenshots

<C-t> once (notice the 3 spaces before the cursor and the one after):
image

<C-t> a second time (notice the cursor didn't move, appended 4 more spaces to the end):
image

Environment (please complete the following information):

  • Extension (VsCodeVim) version: v1.21.10
  • VSCode version: 1.62.0-insiders
  • OS: Windows 11

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 VSCodeVim with a new line and two presses of , using the reported VSCode and extension versions if available. Trace the indentation/keybinding entry point and inspect how the cursor position is updated after inserted spaces. Done means repeated presses keep the cursor ahead of all inserted indentation, with a regression test covering the behavior.

Written by the indexing model from the issue text.

Assessment

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