vim: Respect auto_indent setting in o/O commands - #53620
Merged
ConradIrwin merged 1 commit intoApr 22, 2026
Merged
Conversation
zed-codeowner-coordinator
Bot
requested review from
a team,
SomeoneToIgnore and
as-cii
and removed request for
a team
April 10, 2026 11:53
SomeoneToIgnore
requested review from
dinocosta
and removed request for
SomeoneToIgnore
April 10, 2026 12:16
Member
|
Neat, thanks for the fix. |
ConradIrwin
enabled auto-merge (squash)
April 20, 2026 17:28
When `auto_indent` is set to `none`, the vim `o` and `O` commands were still copying the current line's indentation into the new line, ignoring the user's setting. New lines now start at column 0 as expected. Fixes zed-industries#53570
auto-merge was automatically disabled
April 22, 2026 09:41
Head branch was pushed to by a user without write access
davidalecrim1
force-pushed
the
worktree-zed-vim-new-line
branch
from
April 22, 2026 09:41
ae230cd to
73d2947
Compare
Contributor
Author
|
@ConradIrwin I had to rebase this given a failing test that came from main unrelated to this change. |
ConradIrwin
enabled auto-merge (squash)
April 22, 2026 16:34
ConradIrwin
approved these changes
Apr 22, 2026
Member
|
Thanks, and sorry for missing that. |
5 tasks
kathbigra
pushed a commit
to kathbigra/zed
that referenced
this pull request
May 10, 2026
## Summary Closes zed-industries#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
Zenor27
pushed a commit
to Zenor27/zed
that referenced
this pull request
Jul 4, 2026
## Summary Closes zed-industries#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
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
## Summary Closes zed-industries#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
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
## Summary Closes zed-industries#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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #53570
oandOin normal mode were unconditionally copying the current line's indentation into the new line, ignoring theauto_indentsetting entirelyauto_indent: "none"is set, new lines created byo/Onow start at column 0 as expectedauto_indentispreserve_indentorsyntax_aware, behavior is unchangedThe fix reads
language_settings_atfor the relevant row and splits edits into two paths:editor.edit()(no autoindent) forNone, andeditor.edit_with_autoindent()for everything else — mirroring the approach already used by the non-vimNewlineaction.Test plan
test_o_auto_indent_none: verifieso/Oproduce column-0 lines withauto_indent: "none", including edge cases (first line, empty line)test_o_preserve_indent: verifieso/Ocopy the current line's indentation withauto_indent: "preserve_indent"(regression guard)test_o,test_insert_line_above,test_o_comment) continue to passRelease Notes:
o/Ocommands ignoring theauto_indent: "none"setting, causing new lines to inherit indentation instead of starting at column 0