vim: Apply strict paragraph motion only in vim mode#48024
Merged
dinocosta merged 2 commits intozed-industries:mainfrom Feb 17, 2026
Merged
vim: Apply strict paragraph motion only in vim mode#48024dinocosta merged 2 commits intozed-industries:mainfrom
dinocosta merged 2 commits intozed-industries:mainfrom
Conversation
Contributor
|
Friendly ping. |
Contributor
Author
Screen.Recording.2026-02-04.at.11.55.48.AM.movThis screen cap starts in regular mode and demonstrates the ^+down and ^+up work normally It then switches to vim mode and shows { and } skipping the appropriate lines |
d6a53bb to
ca5d735
Compare
Addresses feedback from zed-industries#47734: the previous change affected all users, but the stricter "empty line only" paragraph behavior (per vim's :help paragraph) should only apply in vim mode. - Revert editor's paragraph functions to use is_line_blank() (whitespace lines count as boundaries for non-vim users) - Add vim-specific paragraph_backwards/paragraph_forwards that use line_len() == 0 (only truly empty lines are boundaries) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ca5d735 to
7ee39fb
Compare
* Rename `vim::motion::paragraph_backwards` to `vim::motion::start_of_paragraph` and `vim::motion::paragraph_forwards` to `vim::motion::end_of_paragraph` to align it with the action and command name * Update the existing editor test for paragraph start and end to ensure that non-blank lines, i.e., lines with only whitespace characters, are also considered paragraph boundaries, contrary to what vim mode does
rtfeldman
pushed a commit
that referenced
this pull request
Feb 17, 2026
Reverts the editor's paragraph navigation behavior that was changed in #47734. Whitespace-only lines are now treated as paragraph boundaries again for non-vim mode users. Vim mode retains its own implementation where only truly empty lines are paragraph boundaries. Release Notes: - Fixed editor paragraph navigation to treat whitespace-only lines as paragraph boundaries again --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: dino <dinojoaocosta@gmail.com>
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
is_line_blank()(whitespace lines count as paragraph boundaries for non-vim users)paragraph_backwards/paragraph_forwardsthat useline_len() == 0(only truly empty lines are boundaries per vim's:help paragraph)This preserves vim compatibility while avoiding regression for non-vim users.
Test plan
cargo test -p vim -p editorpasses (463 tests)cargo clippy -p vim -p editorpasses{/}in vim mode skips whitespace-only lines🤖 Generated with Claude Code
Release Notes: