Skip to content

Add mouse/keyboard text selection with clipboard copy feedback#14

Merged
enijburg merged 1 commit into
mainfrom
codex/implement-text-selection-with-visual-feedback
May 15, 2026
Merged

Add mouse/keyboard text selection with clipboard copy feedback#14
enijburg merged 1 commit into
mainfrom
codex/implement-text-selection-with-visual-feedback

Conversation

@enijburg
Copy link
Copy Markdown
Owner

Motivation

  • Add interactive text selection so users can select and copy bytes from the memory-mapped view with both mouse and keyboard.
  • Provide visible feedback (reversed video) for selection and status messages when copying succeeds or fails.

Description

  • Introduce selection state and status text to Viewer (cursor_offset, selection_anchor, selection_focus, status_message) and wire selection-aware rendering so selected ranges render with reverse-video alongside existing search highlights.
  • Implement mouse-based selection: click to start, drag to extend, and release to finish selection with a footer status message showing selection size and instructions.
  • Implement keyboard selection extension with Shift+Left/Right to adjust selection and Ctrl+C to copy the selected bytes to the system clipboard using the arboard crate, with success/failure messages shown in the footer.
  • Add helper functions selection_range, clear_selection, and offset_for_line_col to map screen coordinates and tab-aware columns to byte offsets for accurate selection.

Testing

  • Ran cargo fmt successfully in the workspace.
  • Attempted cargo test, but it failed to fetch crates from crates.io due to network/proxy restrictions in the environment (failed downloading config.json), so unit tests were not executed here.

Codex Task

@enijburg enijburg merged commit 84ca2cd into main May 15, 2026
2 checks passed
@enijburg enijburg deleted the codex/implement-text-selection-with-visual-feedback branch May 15, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant