Add rectangular block selection and clipboard copy; refactor rendering and update deps#16
Merged
Conversation
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.
Motivation
Description
Viewerwithblock_selection_anchorandblock_selection_focus, plus ablock_selection_range()accessor andline_display_chars()helper to map visual columns to characters.copy_selection_to_clipboard()function that handles both block and linear selections and updatesviewer.status_messageon success or failure.Ctrl, to update block focus while dragging, and to copy on right-click; linear selection behavior is preserved otherwise.push_charlogic into a top-levelpush_char()helper used byrender_line()to handle left-column clipping, visible width limits, and segment building.render_line()will include block selection when computing highlight segments.Cargo.lockwith additional dependencies (clipboard/GUI/image/PNG/TIFF related crates and windows targets) required by the new clipboard and block selection implementation.Testing
cargo buildand the build completed successfully.cargo testand all tests passed.Codex Task