Skip to content

vi: word motions via resolve_motion (motion half of #1059)#1077

Draft
kronberger-droid wants to merge 5 commits into
nushell:mainfrom
kronberger-droid:editmode-resolve-motion
Draft

vi: word motions via resolve_motion (motion half of #1059)#1077
kronberger-droid wants to merge 5 commits into
nushell:mainfrom
kronberger-droid:editmode-resolve-motion

Conversation

@kronberger-droid
Copy link
Copy Markdown
Contributor

Summary

Adds opt-in EditMode::resolve_motion.
Vi implements it with three-class word segmentation.
Fixes w/W/e/E/b/B on punctuated text:foo.bar now 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.rs covering ASCII punctuation, whitespace runs, edge cases, and Unicode (combining marks, ZWJ emoji). 900 existing lib tests pass unchanged.

Manual: cargo run --example demo -- --vi

kronberger-droid and others added 5 commits May 15, 2026 17:41
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>
@kronberger-droid
Copy link
Copy Markdown
Contributor Author

@fdncred would love to have your opinion on this.

@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented May 15, 2026

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants