mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-25 06:24:56 +00:00
## Summary Closes #53570 - `o` and `O` in normal mode were unconditionally copying the current line's indentation into the new line, ignoring the `auto_indent` setting entirely - When `auto_indent: "none"` is set, new lines created by `o`/`O` now start at column 0 as expected - When `auto_indent` is `preserve_indent` or `syntax_aware`, behavior is unchanged The fix reads `language_settings_at` for the relevant row and splits edits into two paths: `editor.edit()` (no autoindent) for `None`, and `editor.edit_with_autoindent()` for everything else — mirroring the approach already used by the non-vim `Newline` action. ## Test plan - Added `test_o_auto_indent_none`: verifies `o`/`O` produce column-0 lines with `auto_indent: "none"`, including edge cases (first line, empty line) - Added `test_o_preserve_indent`: verifies `o`/`O` copy the current line's indentation with `auto_indent: "preserve_indent"` (regression guard) - Existing neovim-backed tests (`test_o`, `test_insert_line_above`, `test_o_comment`) continue to pass Release Notes: - Fixed vim `o`/`O` commands ignoring the `auto_indent: "none"` setting, causing new lines to inherit indentation instead of starting at column 0 |
||
|---|---|---|
| .. | ||
| digraph | ||
| helix | ||
| normal | ||
| test | ||
| change_list.rs | ||
| command.rs | ||
| digraph.rs | ||
| helix.rs | ||
| indent.rs | ||
| insert.rs | ||
| mode_indicator.rs | ||
| motion.rs | ||
| normal.rs | ||
| object.rs | ||
| replace.rs | ||
| rewrap.rs | ||
| state.rs | ||
| surrounds.rs | ||
| test.rs | ||
| vim.rs | ||
| visual.rs | ||