vi: word motions via resolve_motion (motion half of #1059)#1077
Draft
kronberger-droid wants to merge 5 commits into
Draft
vi: word motions via resolve_motion (motion half of #1059)#1077kronberger-droid wants to merge 5 commits into
kronberger-droid wants to merge 5 commits into
Conversation
Default-none trait method; every motion still falls through to LineBuffer.
Three-class word segmentation for w/W/e/E/b/B. Operators are follow up.
Iterate by grapheme cluster so multi-codepoint sequences move as one unit. Minor cleanup in resolve_motion dispatch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@fdncred would love to have your opinion on this. |
Contributor
|
@kronberger-droid would you mind pinging me on Discord for an unrelated chat? This is the nushell Discord if you're not a member already https://discord.gg/NtAbbGn |
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
Adds opt-in
EditMode::resolve_motion.Vi implements it with three-class word segmentation.
Fixes
w/W/e/E/b/Bon punctuated text:foo.barnow segments as three small-words instead of one big-word.Motion half of #1059. Operator variants (
dw/cw/yw/…) are follow-up.Tests
37 unit tests in
src/edit_mode/vi/word.rscovering ASCII punctuation, whitespace runs, edge cases, and Unicode (combining marks, ZWJ emoji). 900 existing lib tests pass unchanged.Manual:
cargo run --example demo -- --vi