VSCodeVim / VSCodeVim/Vim

`S`/`cc` doesn't auto indent on empty line

Open
#1,017 32 comments 61 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When your in Normal mode and your on an empty line and the cursor is at the very left, pressing 'S' in normal Vim auto indents the line and goes into insert mode, but VS Vim doesn't seem to indent at all.

Technical details:
  • VSCode Version: 1.6.1
  • VsCodeVim Version: 0.4.0
  • OS: OSX El capitan

What happened:

  • Typing cc when cursor is at col 0 and in block on empty line: Jumping to input mode, but won't indent correctly
  • Typing cc when cursor is at col 2 (or any col): Removes line and ends up at col 0 with no indentation
  • Typing cc when cursor is at col 0 but there is valid code on line that is inside a block: Removes line as it should do, but cursor ends at col 0 with trailing whitespace
  • Typing cc when cursor is at col >2 (in block, line with valid code, cursor on code): Removes line of code and indents correctly ✅

Here all of those scenarios in a GIF (with tab width of 3 instead of 2)
cc

Contributed by @lumio at https://github.com/VSCodeVim/Vim/issues/1828.

What did you expect to happen: Typing cc will always clear the line, indents it and cursor jumps to end of line.

How to reproduce it: See above, but typically typing cc on different col positions.

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

No files or tests are named. Reproduce cc and S on empty and non-empty lines at different cursor columns in VS Code, then trace the Normal-mode handling and indentation behavior. Done means each scenario clears the line, preserves the expected block indentation, and enters insert mode at the line end.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.