feat(core): Add in functionality for double-click word selection and triple-click line selection#1229
feat(core): Add in functionality for double-click word selection and triple-click line selection#1229Karvy-Singh wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds multi-click mouse selection support for edit-buffer-backed renderables (e.g., Textarea) so double-click selects the clicked word and triple-click selects the clicked line, with regression tests covering the new selection behaviors.
Changes:
- Track consecutive clicks in
CliRendererand intercept double-/triple-clicks forEditBufferRenderablebefore the normal drag-selection path. - Implement word-token and line selection helpers on
EditBufferRenderable. - Add selection regression tests for double-click word selection and triple-click line selection (plus boundary cases).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/core/src/renderer.ts | Adds click-sequence tracking and dispatches edit-buffer multi-click selection actions. |
| packages/core/src/renderables/EditBufferRenderable.ts | Implements selectWordAt / selectLineAt and supporting word-token detection. |
| packages/core/src/renderables/tests/Textarea.selection.test.ts | Adds regression tests for new multi-click selection behaviors and edge cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Hello @simonklee and @kommander, Have you had a chance to review the code for the feature ? (P.S. Thank you for running the checks earlier, ever since I have only merged the latest change done for updating Node version in my existing PR.) |
Adds multi-click mouse selection support for edit-buffer renderables.
(solves #74 and #744 )
Behavior:
Notes:
(Video below shows the implementation of functionalities as mentioned above)
(Tested against the
bun run devInput->Editor Demo inpackages/examples/)output.mp4