VSCodeVim / VSCodeVim/Vim

Indentation -sometimes- changes after exiting insert mode

Open
#2,693 2 comments 3 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

Is this a BUG REPORT or FEATURE REQUEST? (choose one):

Bug report

What happened:

I'm on a line in normal mode:

def something():|

If I press o the next line will be indented, like this:

def something():
    |

If I...

  1. Press <esc>, the indentation will be lost after returning to normal mode (this used to not be the case, but is now!):
def something():
|
  1. Press e.g. <c-f><esc>, the indentation will not be lost after returning to normal mode:
def something():
    |

What did you expect to happen:

Consistent behaviour. Preferably the second one, pressing esc should take me out of insert mode, not modify text!

Environment:

  • Extension (VsCodeVim) version: v0.12.0
  • VSCode version: April 2018 (version 1.23)
  • OS version: MacOS High Sierra

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 reported sequence in VSCodeVim with the stated VSCode Vim extension and editor versions: press o, then <esc>, and compare it with <c-f><esc>. Trace the insert-mode handling for these key sequences and verify that exiting insert mode preserves the indentation consistently without changing the text.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.