-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement double/triple/quadruple click in TextArea #5405
Draft
darrenburns
wants to merge
5
commits into
main
Choose a base branch
from
text-area-click-chain-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
5edcab0
Implement double/triple/quadruple click in TextArea
darrenburns cfe93cb
Add a docstring
darrenburns 6ce0ff0
Update changelog
darrenburns 96c42c4
Merge branch 'main' into text-area-click-chain-support
darrenburns 68101a0
Fix click chain support
darrenburns File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this shouldn't use modulus. It doesn't look like vscode wraps the click chain in this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Experimented with this. For now wrapping works better for us for reasons™.
Without the modulus here, when we get to
chain == 5
and above, the selection goes back to being a cursor and it appears the click chaining stops working. I think the wrapping behaviour feels better than this, although I think the end-goal should be replicating VSCode's approach of doing nothing on the additional clicks and keeping the whole document selected, but that's just a bit tricky for now...I think VSCode does chaining on the "mouse down" event. This would let us do a better implementation of this and remove a subtle flicker (between chain 2 and 3, the selection disappears briefly as we set the location in the mouse down handler, then the click handler fires later and selects the line). While we only have it on the click event, it's very difficult to replicate their behaviour exactly.