feat(mouse): triple-click selects the whole line#80
Merged
Conversation
Extend the click tracker to carry a running click count so a third rapid press within the 400 ms / 4 px window is detected. Triple-click selects the entire line under the cursor, leaves it highlighted in anchored Visual mode, and copies it to the clipboard, mirroring the existing double-click word behavior.
roramirez
force-pushed
the
feat/triple-click-line-select
branch
from
July 18, 2026 21:12
71edbff to
e4aec93
Compare
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
Adds triple-click line selection. Today double-click selects a word; a third rapid click now selects the entire line under the cursor, leaves it highlighted in anchored Visual mode, and copies it to the clipboard — mirroring the existing double-click copy behavior.
Changes
src/app_state.rs:last_clicknow carries a running click count (Option<(Instant, f64, f64, u8)>). NewAppState::click_countreturns 1/2/3 within the 400 ms / 4 px window (a 4th rapid click cycles back to a fresh single; a press outside the window resets to 1).src/app_event.rs: replacedis_double_clickwith aclick_count-driven dispatch inhandle_selection_click— 3 → line select, 2 → word select, 1 → start drag selection.src/input/mouse_ops.rs: newselect_line_atthat anchors a full-row Visual selection (start_col = 0,cur_col = cols-1) and copies it.CHANGELOG.md: entry under[Unreleased] → Added.select_line_atproducing a full-row anchored Visual selection.How to test
cargo test— new tests:click_count_*insrc/app_state_test.rsandselect_line_at_*insrc/input/mouse_ops_test.rs.