vim: Continue multiline comments with `o` (#63751)
# Objective
In Vim mode, pressing `o` to open a line inside a documentation-style
block comment preserves indentation but drops the `* ` prefix.
The behavior for pressing Return is already correct as it continues this
prefix in the next line.
This change makes both actions behave consistently.
Fixes #55049
## Solution
Make Vim’s `o` and `O` commands copy documentation-comment prefixes such
as `* ` onto the new line. This happens only when the current line is
parsed as a comment.
Also added regression coverage for this and folded it into the existing
`test_o_comment` test.
## Testing
- `CC=clang CXX=clang++ cargo test -p vim test_o_comment -- --nocapture`
- `CC=clang CXX=clang++ cargo test -p vim`
- `CC=clang CXX=clang++ cargo test -p multi_buffer`
- `cargo fmt --all -- --check`
- `CC=clang CXX=clang++ ./script/clippy -p vim -p multi_buffer`
- Tested on Linux aarch64.
## Self-Review Checklist:
- [x] I reviewed the diff for quality, security, and reliability
- [x] Unsafe blocks, if any, have justifying comments
- [x] The content adheres to the Zed UI standards
- [x] Tests cover the changed behavior
- [x] Performance impact is acceptable
---
Release Notes:
- Fixed Vim `o` comment continuation in C-style multiline comments.
52af3dd60cIbrahim Khan committed on 9/4/2026, 11:09:15 AM· committed by GitHubparent9c3e2a0