When within a comment block, with formatOnType enabled, new line with `o` has different behavior than with Enter key
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
When typing inside a multi-line comment, like for instance C#, where each comment line starts with "//" or "///", inserting a new line by pressing the "Enter" key will, if you have "formatOnType" enabled, create a new line with the "//" characters already inserted. But if you create a new line by pressing "o" you just get a new blank line.
To Reproduce
Steps to reproduce the behavior:
- Create a C# file
- Have "editor.formatOnType" set to "true".
- Create a new comment block on top of a function or class by typing "///" and then "enter".
- Inside the comment block, create a new line by pressing
oin normal mode. - You get a new blank line, with no "//" on the start of the line.
Expected behavior
I would expect that, like when creating a new line by pressing the Enter key, the new line would be created with the comments' "//" already inserted.
Screenshots
Initially:

When pressing enter in insert mode:

When pressing o in normal mode:

Environment (please complete the following information):
- Extension (VsCodeVim) version: v1.22.2
- VSCode version: 1.67.1
- OS: MacOS 12.3.1
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
No source file or test is named. Reproduce the C# multiline-comment case in VSCodeVim with editor.formatOnType enabled, comparing Enter in insert mode with o in normal mode. Done means opening a new line with o preserves the comment prefix consistently with Enter.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 32/100