Skip to content

Preserve conversion hotkeys after cursor movement#129

Merged
qqrm merged 5 commits into
devfrom
codex/fix-cursor-word-line-hotkeys
May 31, 2026
Merged

Preserve conversion hotkeys after cursor movement#129
qqrm merged 5 commits into
devfrom
codex/fix-cursor-word-line-hotkeys

Conversation

@qqrm

@qqrm qqrm commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • Preserve the input journal around Left/Right cursor movement so convert-last-sequence works before the current caret, not only at the journal end.
  • Add regression coverage for cursor movement, mid-buffer insertion/backspace, UTF-8 boundaries, suffix preservation, and autoconvert triggers before the caret.
  • Add a Windows Sandbox interactive E2E harness for isolated desktop validation of the real keyboard hook and SendInput path.

Problem

Cursor navigation cleared the input journal, so convert word/sequence hotkeys stopped working after moving the caret backward or forward.

Solution

The journal now tracks caret distance from the end, detaches/restores suffix runs around that caret, and extracts the last run/sequence before the caret while preserving text after it. Left/Right update the tracked caret position, End returns it to the journal end, and unsafe navigation keys still clear the journal.

Scope

Included: input journal cursor tracking, regression tests, and an isolated Windows Sandbox E2E harness.

Not included: version bump, release packaging, or a completed sandbox run on this host because Windows Sandbox is not installed/enabled here.

Validation

  • cargo +nightly fmt --check
  • cargo +nightly clippy --all-targets --all-features -- -D warnings
  • cargo +nightly build --features debug-tracing
  • cargo +nightly test --locked
  • cargo +nightly build --release --locked
  • actionlint -color
  • zizmor --min-severity medium .
  • git diff --check
  • PowerShell parse check for scripts/e2e/run-sandbox.ps1 and scripts/e2e/sandbox-runner.ps1
  • scripts/e2e/run-sandbox.ps1 -NoWait was attempted and correctly reported missing Windows Sandbox on this host.

Risks

The true interactive E2E scenario still needs to run on a Windows host with Windows Sandbox enabled. Home/Up/Down/Page navigation still invalidates the journal because the hook cannot reliably infer arbitrary line/document positions without a focused-control integration.

@qqrm qqrm merged commit eaf3cbf into dev May 31, 2026
8 checks passed
@qqrm qqrm deleted the codex/fix-cursor-word-line-hotkeys branch May 31, 2026 08:09
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.

1 participant