Skip to content

feat(rust-lite): mirror the editor word and line keys - #46

Merged
backnotprop merged 1 commit into
mainfrom
feat/rust-lite-editor-keys
Sep 10, 2026
Merged

feat(rust-lite): mirror the editor word and line keys#46
backnotprop merged 1 commit into
mainfrom
feat/rust-lite-editor-keys

Conversation

@backnotprop

Copy link
Copy Markdown
Contributor

Brings the native Rust Lite editor to parity with the Bun editor's word and line keys from #34: Option/Alt and Ctrl arrows move by word, Command arrows move to line edges, Alt+b/f word moves, Ctrl+A/E line moves, Ctrl+W and Alt+Backspace delete a word, Ctrl+U deletes to line start. Newline crossing and CJK word runs match the Bun helpers, and the JavaScript whitespace class is spelled out so U+0085 and U+FEFF behave identically.

Crossterm decodes xterm modifier 9 as SUPER only, so line moves are gated on SUPER; Node folds modifiers 3 and 9 into one flag and reads the raw sequence. All thirteen sequences resolve to the same action on both sides.

Parity: two new PTY cases (moves and kills) with store-byte comparison; 510 -> 622 observables, zero divergences. Negative controls on two helpers produce 21 and 17 divergences. Live: both runtimes saved alpha X for the same keystrokes inside Herdr; smoke-rust-lite and smoke both 0 failures.

Closes #38

Port `src/edit-keys.ts` to `rust/src/edit_keys.rs` so the native editor moves
and kills by the same boundaries as the Bun runtime: Option/Alt and Ctrl arrows
plus Alt+B/Alt+F move by word, Command/Super arrows and Ctrl+A/Ctrl+E move to
the line edges, and Ctrl+W, Alt+Backspace, and Ctrl+U kill back to a word or
line start. Word boundaries use JavaScript's `\s` class, cross a newline one
step at a time, and treat a CJK run as one word.

Add `screen.editor.word-line-moves` and `screen.editor.word-line-kills` to the
parity harness, which send the raw byte sequence for every new key and type a
marker after each move, and record the result in both parity documents.

refs #38
@backnotprop
backnotprop merged commit 2add0da into main Sep 10, 2026
4 checks passed
@backnotprop
backnotprop deleted the feat/rust-lite-editor-keys branch September 10, 2026 04:58
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.

rust lite: mirror the editor word and line keys from #34

1 participant