Skip to content
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

Introduce switchSelectionEndpoint action #13370

Merged
5 commits merged into from
Jul 1, 2022

Conversation

carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented Jun 23, 2022

Summary of the Pull Request

Introduces the switchSelectionEndpoint action which switches whichever selection endpoint is targeted when a selection is present. For example, if you are targeting "start", switchSelectionEndpoint makes it so that now you are targeting "end". This also updates the selection markers appropriately.

References

Spec - #5804
#13358
Closes #3663

Detailed Description of the Pull Request / Additional comments

Most of the code is just standard code of adding a new action. Other than that, we have...

  • if there is no selection, the action fails and the keybinding is passed through (similar to copy())
  • when we update the selection endpoint, we need to also update the "pivot". This ensures that future calls of UpdateSelection() respect this swap.
  • [Corner Case] if the cursor is being moved, we make it so that you basically "anchored" an endpoint and you don't have to hold shift anymore.

@github-actions

This comment was marked as resolved.

@zadjii-msft zadjii-msft added this to the Terminal v1.15 milestone Jun 23, 2022
@ghost ghost added Area-Input Related to input processing (key presses, mouse, etc.) Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. labels Jun 28, 2022
@carlos-zamora carlos-zamora force-pushed the dev/cazamor/kbd-sln/switchSelectionEndpoint branch from 04a6d0b to 2e48423 Compare June 30, 2022 23:30
@DHowett
Copy link
Member

DHowett commented Jun 30, 2022

@msftbot merge this in 18 hours

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jun 30, 2022
@ghost
Copy link

ghost commented Jun 30, 2022

Hello @DHowett!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Fri, 01 Jul 2022 17:38:42 GMT, which is in 18 hours

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@carlos-zamora carlos-zamora removed the AutoMerge Marked for automatic merge by the bot when requirements are met label Jun 30, 2022
@carlos-zamora
Copy link
Member Author

Suggestion for me:

  • a gentle rename on shouldMoveCursor (should mean shouldMoveBothSelectionEndpoints) and anchorSelectionEndpoint (it means something like, "anchor WHICH endpoint we are moving")

@carlos-zamora carlos-zamora force-pushed the dev/cazamor/kbd-sln/switchSelectionEndpoint branch from 2e48423 to 02d6a07 Compare June 30, 2022 23:55
Base automatically changed from dev/cazamor/kbd-sln/polish to main July 1, 2022 01:07
@DHowett DHowett force-pushed the dev/cazamor/kbd-sln/switchSelectionEndpoint branch from 02d6a07 to 5e49772 Compare July 1, 2022 01:10
@DHowett
Copy link
Member

DHowett commented Jul 1, 2022

@msftbot merge this in 4 minutes

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jul 1, 2022
@ghost
Copy link

ghost commented Jul 1, 2022

Hello @DHowett!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Fri, 01 Jul 2022 01:22:48 GMT, which is in 4 minutes

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit 7b8a53c into main Jul 1, 2022
@ghost ghost deleted the dev/cazamor/kbd-sln/switchSelectionEndpoint branch July 1, 2022 01:44
@carlos-zamora carlos-zamora restored the dev/cazamor/kbd-sln/switchSelectionEndpoint branch July 1, 2022 17:08
@carlos-zamora carlos-zamora deleted the dev/cazamor/kbd-sln/switchSelectionEndpoint branch July 1, 2022 17:09
ghost pushed a commit that referenced this pull request Jul 5, 2022
## Summary of the Pull Request
In #13370, we should be notifying the renderer that the selection changed. Minor oversight and simple fix.

## References
#4993
#13370 
Closes #13413
DHowett pushed a commit that referenced this pull request Jul 5, 2022
## Summary of the Pull Request
In #13370, we should be notifying the renderer that the selection changed. Minor oversight and simple fix.

## References
#4993
#13370
Closes #13413

(cherry picked from commit 66ecb0b)
Service-Card-Id: 83892665
Service-Version: 1.15
@ghost
Copy link

ghost commented Jul 6, 2022

🎉Windows Terminal Preview v1.15.186 has been released which incorporates this pull request.:tada:

Handy links:

@penguin359
Copy link

Chocolatey is still on 1.14.2281.0 for Windows Terminal so waiting for 1.15.x to come down the pipe.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Input Related to input processing (key presses, mouse, etc.) AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mark Mode: Toggle instead of holding shift
5 participants