Shift+o doesn't respect indentation setting (when using Autoindent)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
My indentation is set to spaces. When using o to add a new line below the cursor, it starts indented with spaces but when pressing O (Shift+o) to add a line above the cursor, it sometimes uses tabs instead.
To Reproduce
Steps to reproduce the behavior:
- Open a new file in VS Code, set indentation to spaces, enable "Vim: Autoindent", and use the following text:
def test():
····print("test")
····return
- Go to line 3.
- If I press o, a new line begins below the cursor and inserts spaces:
def test():
····print("test")
····|
····return
- If I press Shift+o instead, a new line begins above the cursor and inserts tabs:
def test():
→ |
····print("test")
····return
Expected behavior
Respect the indentation setting in all cases.
Screenshots
Environment (please complete the following information):
- Extension (VsCodeVim) version: v1.26.0
- VSCode version: v1.83.0
- OS: Windows 10
Additional context
n/a
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in VS Code with VSCodeVim using the Python example, spaces indentation, and Vim: Autoindent enabled. Compare the behavior of o and Shift+o, then trace their key handling and verify that both insert the new line using the configured indentation.
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
- 45/100