Skip to content

Commit

Permalink
Connect clipboard functionality to their keybindings (microsoft#1093)
Browse files Browse the repository at this point in the history
* Connects clipboard functionality to their keybindings.

* Cleaning up comments and whitespace.

* Added "copyTextWithoutNewlines" keybinding.

* Fixing tabs in idl file

* Fixing merge conflicts

* Adding default keybindings for copy and paste to ctrl-shift-c and ctrl-shift-v, respectively.

* Complying with refactoring

* Fixing formatting issues
  • Loading branch information
d-bingham authored and mcpiroman committed Jul 23, 2019
1 parent 29eb59d commit bbfc815
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/cascadia/TerminalApp/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ namespace winrt::TerminalApp::implementation
bindings.ScrollDownPage([this]() { _ScrollPage(1); });
bindings.SwitchToTab([this](const auto index) { _SelectTab({ index }); });
bindings.OpenSettings([this]() { _OpenSettings(); });
bindings.CopyText([this](const auto trimWhitespace) { _CopyText(trimWhitespace); });
bindings.PasteText([this]() { _PasteText(); });
}

// Method Description:
Expand Down Expand Up @@ -1015,6 +1017,14 @@ namespace winrt::TerminalApp::implementation
control.CopySelectionToClipboard(trimTrailingWhitespace);
}

// Method Description:
// - Paste text from the Windows Clipboard to the focused terminal
void App::_PasteText()
{
const auto control = _GetFocusedControl();
control.PasteTextFromClipboard();
}

// Method Description:
// - Sets focus to the tab to the right or left the currently selected tab.
void App::_SelectNextTab(const bool bMoveRight)
Expand Down

0 comments on commit bbfc815

Please sign in to comment.