feat(core): double/triple word/line select + click-drag word snap #887
Open
phall1 wants to merge 1 commit intoanomalyco:mainfrom
Open
feat(core): double/triple word/line select + click-drag word snap #887phall1 wants to merge 1 commit intoanomalyco:mainfrom
phall1 wants to merge 1 commit intoanomalyco:mainfrom
Conversation
…lick-drag word snap Wire up multi-click selection in the renderer's mouse event pipeline: - Double-click selects the word under the cursor - Triple-click selects the full visual line - Double-click-drag extends selection by whole word boundaries Add grapheme-aware word boundary detection (selection-primitives.ts) using Intl.Segmenter with support for CJK, emoji clusters, decomposed accents, and punctuation boundaries. Extract shared visual line probing behind a SelectionProbeView interface to eliminate duplication between EditBufferRenderable and TextBufferRenderable.
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.
Multi-click text selection (double-click word, triple-click line, word-snap drag)
Add standard terminal/editor selection behavior to OpenTUI: double-click selects a word, triple-click selects a line, and dragging after double-click expands by whole words.
The renderer now tracks click sequences and exposes MouseEvent.clickCount, then uses that in mouse handling to trigger word/line selection paths. Word boundaries are computed with Unicode grapheme segmentation (Intl.Segmenter) so emoji clusters, CJK, and combining marks select correctly. I also extracted the selection probing logic into shared primitives to remove duplication between text/edit buffer renderables.
One important behavioral fix included here: word-snap drag updates no longer prematurely end selection state during drag; selection finalization now happens correctly on mouse-up.
resolves #744