Vim: o and O on indented line provide wrong indent / strip character

Created on 9 Oct 2016  路  10Comments  路  Source: VSCodeVim/Vim

What did you do?

Given a piece of (python) code with indenting

    # comment _

where _ marks the cursor, pressing O should add a line above and 'o' should add an indented line below

What did you expect to happen?

A line to be added with the proper indent

What happened instead?

Inserting the line above (O) seems to remove a character. The cursor seems to start at column two and then backspace to cursor one. However, the first space I hit seems to be ignored. I have to add 5 spaces in stead of 4 to match my indent below

Inserting below (o) does something similar: The cursor starts initially at the right indent but then jumps back one column

Technical details:

  • VSCode Version: 1.5.2
  • VsCodeVim Version: 0.3.3
  • OS: Ubuntu 16.04 64bit
kinbug

Most helpful comment

Additionally, when I create a new empty file and hit 'i' to insert, the first two letters I type get swapped.

All 10 comments

Perhaps introduced by the fix for issue #574

Additionally, when I create a new empty file and hit 'i' to insert, the first two letters I type get swapped.

@iivvoo I am unable to reproduce this...can you provide me a bigger snippet for a complete file that I can use for testing? o and O are behaving as they are supposed to in this file for me

#test
if(True):
  print("test")
  #test
  #test

Regarding your second issue for the new file, and swapping the first two letters...I can't reproduce this either, can you open its own issue? How are you opening a new file

ah I think I can see your 2nd issue with files acting funny, I was able to reproduce it kind of

When this happens, is the cursor a | or a block cursor? does it change as you go left/right?

Yeah, you're totally right. Gonna look into this...

Ugh, this is really tricky to reproduce when you want to reproduce it.

Is this fixed now? I can't reproduce it anymore

@johnfn @rebornix

I can't reproduce this anymore. Close?

(I found this issue while searching for the closest match for the bug I'm seeing.)

ovsshifto

VSC 1.8.1, Linux 32-bit (Debian), Vim 0.5.2.

@johnfn this looks like it can be closed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jimmy-Z picture Jimmy-Z  路  3Comments

liamdawson picture liamdawson  路  3Comments

elithrar picture elithrar  路  3Comments

spinningarrow picture spinningarrow  路  3Comments

triztian picture triztian  路  3Comments