VSCodeVim / VSCodeVim/Vim

`<Esc>` after creation of a new auto-indented line in insert mode does not remove whitespace

Open
#3,515 1 comment 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

While typing text in insert mode with the Auto Indent setting enabled, Esc immediately following the creation of a new auto-indented line (via Enter/Return) will leave behind whitespace.

With Vim, all such whitespace is removed as soon as Esc is hit, leaving only a blank line.

To Reproduce

While in insert mode with the Auto Indent setting enabled, type the following:

this
<tab>is
a
test
<esc>

Expected behavior

Vim result:

this
    is
    a
    test
|

Unexpected VSCodeVim result:

this
    is
    a
    test
   |

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.0.8
  • VSCode version: 1.31.1
  • OS: Windows 10 x64 10.0.17763

Additional context

Behavior appears to be correct with regard to new lines created via O or o, but not with regard to basic text entry while in insert mode.

Related to issue: #2693

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 insert-mode case with Auto Indent enabled, pressing Enter and then Esc, and compare it with the working O and o cases. Trace the Enter and Esc handling in the VSCodeVim extension; done means Esc removes the newly created line's indentation as Vim does.

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.