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

Encapsulate dispatching ShortcutActions in it's own class #3658

Merged
merged 3 commits into from
Nov 27, 2019

Conversation

zadjii-msft
Copy link
Member

Summary of the Pull Request

Moves all the code responsible for dispatching an ActionAndArgs to it's own class, ShortcutActionDispatch. Now, the AppKeyBindings just uses the single instance of a ShortcutActionDispatch that the TerminalPage owns to dispatch events, without the need to re-attach the event handlers every time we reload the settings.

References

This is something I originally did as a part of #2046.

I need this now for #607.

It's also a part of work for #3475

PR Checklist

Detailed Description of the Pull Request / Additional comments

With this change, we'll be able to have other things dispatch ShortcutActions easily, by constructing an ActionAndArgs and just passing it straight to the ShortcutActionDispatch.

Validation Steps Performed

Ran the Terminal, tried out some keybindings, namely Ctrl+c for copy when there is a selection, or send ^C when there isn't. That still works.

Reloading settings also still works.

@zadjii-msft zadjii-msft added Product-Terminal The new Windows Terminal. Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. labels Nov 21, 2019
@zadjii-msft zadjii-msft added this to the Terminal-1912 milestone Nov 21, 2019
…-SAD

# Conflicts:
#	src/cascadia/TerminalApp/AppKeyBindings.cpp
#	src/cascadia/TerminalApp/AppKeyBindings.h
#	src/cascadia/TerminalApp/AppKeyBindings.idl
#	src/cascadia/TerminalApp/TerminalPage.cpp
@zadjii-msft zadjii-msft merged commit 111b88c into master Nov 27, 2019
zadjii-msft added a commit that referenced this pull request Nov 28, 2019
## Summary of the Pull Request

We already have "splitHorizontal" and "splitVertical", but those will both be deprecated in favor of "splitPane" with arguments. 

Currently, there's one argument: "style", which is one of "vertical" or "horizontal."

## References
This is being done in pursuit of supporting #607 and #998. I don't really want to lob #998 in with this one, since both that and this are hefty enough PRs even as they are. (I have a branch for #998, but it needs this first)

This will probably conflict with #3658
## PR Checklist
* [ ] Doesn't actually close anything, only enables #998
* [x] I work here
* [ ] Tests added/passed - yea okay no excuses here
* [x] Requires documentation to be updated

## Validation Steps Performed
Added new keybindings with the args - works
Tried the old keybindings without the args - still works
---------------------------------------
* Add a 'splitPane' keybinding that can be used for splitting a pane either vertically or horizontally

* Update documentation too

* Good lord this is important

* Add a test too, though I have no idea if it works

* "style" -> "split"

* pr comments from carlos
@zadjii-msft zadjii-msft mentioned this pull request Dec 3, 2019
2 tasks
@zadjii-msft zadjii-msft deleted the dev/migrie/f/make-a-SAD branch January 31, 2020 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants