Make Ctrl+F move the caret forward in Program view#687
Merged
Conversation
The web Program editor bound Ctrl+F to its Find bar, so it swallowed the Emacs cursor-forward keystroke the TUI's Program surface already supports. Rebind it to move the caret forward one character (via Selection.modify) and preventDefault so the browser never opens its own Find dialog either. Find is still reachable via the Find button.
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.
Summary
Ctrl+Fto open its Find bar, so it swallowed the Emacs cursor-forward keystroke the TUI's Program surface already supports (C-f→ move caret forward one character).Ctrl+Fto move the caret forward one character (viaSelection.modify("move", "forward", "character")) andpreventDefault()so the browser's native Find dialog never opens either.Ctrl+Fshortcut it doesn't have anymore);docs/program.mdupdated to match.Test plan
cargo build --manifest-path Cargo.toml— clean build, only pre-existing unrelated warnings.crates/e2e/tests/program_view.rsthat dispatches aCtrl+Fkeydown on the Program editor and checks the caret advances by one and the Find bar never opens.construct, confirmed the test fails (head: null,findVisible: true); restored the fix, rebuilt, confirmed it passes.cargo test -p agentd-e2e --test program_view web_program_view_full_paritypasses end-to-end (headless Chromium).