Conversation
Reorganizes handleInput's state machine into clear layers: handleInput dispatches on (state, char) via nested switches directly to leaf _handle* methods, which take their state dependencies as explicit parameters instead of reading `this.*` fields internally. Shared imperative helpers (_moveCursor, _submit, etc.) are replaced by side-effect-free module-level functions (computeCursorMove, computeInsertMove, normalizeTypedChars, etc.) that leaf handlers call before performing their own field mutations and I/O. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The single-field setter methods added earlier for encapsulating mutation no longer earn their keep now that leaf handlers already take their state as explicit parameters; assign fields directly instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Removes intermediate const bindings that were only referenced once, substituting their definitions directly at the (single) use site. Left alone where inlining would change behavior, e.g. wrapForReadMode's firstLine, which must be captured before charLines[0] is mutated. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ions
Splits input handling into free, pure functions (state -> {state, writes, send})
applied through a single _applyEffect, fixing a bug where pasting multi-line input
with a trailing shell-integration carriage return skipped syntax coloring before
submitting.
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.
This PR fixes #1862