Skip to content

shift-O does not preserve indent if empty line above #3840

@iivvoo

Description

@iivvoo

Describe the bug
With auto indent enabled, shift-O to insert a line above the current line does not preserve indent if line above has no indent. Vim does preserve indent in these cases

To Reproduce

Given a piece of indented code (space indented, where empty lines contain no space/indent), with _ as the cursor

    Hello

    World_

when pressing shift-O, the expected Vim behaviour would be

    Hello

    _
    World

but the actual result is

    Hello

_
    World

Environment:

VSCode 1.35.1

Version: 1.35.1
Commit: c7d83e57cd18f18026a8162d042843bda1bcf21f
Date: 2019-06-12T14:27:31.086Z
Electron: 3.1.8
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Linux x64 4.15.0-51-generic

VSCodeVim 1.8.1
Ubuntu 18.04

Additional context
This behaviour was correct a few versions/weeks ago.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions