Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
iivvoo opened this issue Jun 18, 2019 · 3 comments
Closed

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

iivvoo opened this issue Jun 18, 2019 · 3 comments

Comments

@iivvoo
Copy link

iivvoo commented Jun 18, 2019

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.

@jkillian
Copy link
Contributor

Hey @iivvoo just tried your example today, and it seems that VSCodeVim 1.11.3 is working correctly for me. Are you still seeing this issue?

@iivvoo
Copy link
Author

iivvoo commented Oct 27, 2019

I just tried, and I still experience the issue. However, it seems to work fine when editing a .go file and not when editting a .md or .py file.

This made me wonder if it could be a tab (indentation) vs. spaces thing, but setting "detect indentation" and "insert spaces" to false, resulting in tabs in the .py file doesn't make a difference.

I have disabled all extension except for VSCodeVim.

@J-Fields
Copy link
Member

The root cause here is the same as what's described here: #1017 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants