Conversation
The value is app-owned; the caret is a transient. Overlay `|` does not take a column. Word-kill matches what each host actually reports: Ctrl+H on Windows ConPTY and WSL, Option+Backspace on macOS. Closes kristoferlund#26
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.
Closes #26.
What and why
ratcn had twelve components and none of them took typed text. This adds
Input: a one-line field whose string lives in app state and whose caret is a transient.The caret overlays the insertion point as a blinking
|and does not take a column, so moving or blinking it never shifts the letters. A leftDownis ignored so the runtime can still move focus onto the field (the same press-to-focus path a checkbox uses); the followingClickplaces the caret.Word-kill is this field's own chord, but hosts disagree on the bytes. Matching only
Backspace + Ctrlfails on Windows PowerShell and WSL, where ConPTY reports Ctrl+Backspace as Ctrl+H (0x08). The field therefore treats all of these as the same backward kill:0x08(Windows ConPTY, xterm, WSL)Forward kill is Delete with Control (
CSI 3;5~) or with Alt. Ctrl+W still bubbles.Out of scope, on purpose: multi-line, password, selection, undo, max length.
Checks
cargo fmt --allcargo test -p ratcn --all-featurescargo check -p copy-fixture --examplescargo clippy -p ratcn --all-features --all-targets -- -D warningscargo clippy --workspace --all-targets -- -D warningscargo clippy --workspace --exclude cargo-ratcn --all-targets --target wasm32-unknown-unknown -- -D warningscargo test --workspacewas not run to completion on this Windows host:cargo-ratcnhas a pre-existing CRLF assertion inrenders_the_expected_config, unrelated to this change.If applicable
crates/copy-fixture/examples/input.rsadded.Input,InputWidget,InputStyle, plustext_width::{grapheme_count, grapheme_byte, graphemes}so a copied module does not depend onunicode_segmentation. Docs page and changelog updated.demos/input/withTrunk.toml.