Vim
Vim copied to clipboard
incorrect indent with `O`
Describe the bug
O
should insert a line above current place and the indent should be the same as other lines. It works well inside a block, but one tab less when O
is pressed at the end of the block.
Strangely, there is a flash before the cursor goes to the wrong place.
To Reproduce Steps to reproduce the behavior:
And the indent is correct using Ctrl + Shift + Enter
without vim
- Extension (VsCodeVim) version: v1.22.2
- VSCode version: 1.64.2
- OS: Windows 10
Note that vscodevim is following vanilla vim for Shift-O, I guess:
On the other hand, for o
vanilla vim also only opens a new line without indentation ...
For workaround, consider to just use the keystrokes ko
to move the cursor the the line above the closing bracket and then open a line (i.e., just don't use Shift-O
). Also, Shift-O
can be remapped (maybe to ko
, or to Ctrl-Shift-Enter
).
There was a recent fix for this just added: https://github.com/VSCodeVim/Vim/pull/7424 I would say the logic of the PR was that both o and Shift-o should keep the indentation of the current line.
It works fine on 1.21.10
it still does not work on 1.23.1
This issue still exists. Using ko
for now.
it still does not work on 1.25.2
dirty fix
{
"before": ["O"],
"commands": ["editor.action.insertLineBefore"],
"after": ["i"]
},
not using ko
since it wont work on the top of the file