Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into release-0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
DHowett committed Apr 21, 2020
2 parents e752a58 + e3e5708 commit 008d1ba
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/cascadia/profiles.schema.json
Expand Up @@ -278,7 +278,7 @@
"type": "boolean"
},
"copyFormatting": {
"default": false,
"default": true,
"description": "When set to `true`, the color and font formatting of selected text is also copied to your clipboard. When set to `false`, only plain text is copied to your clipboard.",
"type": "boolean"
},
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalApp/defaults-universal.json
Expand Up @@ -9,6 +9,7 @@

// Selection
"copyOnSelect": false,
"copyFormatting": false,
"wordDelimiters": " /\\()\"'-.,:;<>~!@#$%^&*|+=[]{}~?\u2502",

// Tab UI
Expand Down
1 change: 1 addition & 0 deletions src/cascadia/TerminalApp/defaults.json
Expand Up @@ -9,6 +9,7 @@

// Selection
"copyOnSelect": false,
"copyFormatting": true,
"wordDelimiters": " /\\()\"'-.,:;<>~!@#$%^&*|+=[]{}~?\u2502",

// Tab UI
Expand Down
3 changes: 3 additions & 0 deletions src/cascadia/TerminalApp/userDefaults.json
Expand Up @@ -16,6 +16,9 @@
// If enabled, selections are automatically copied to your clipboard.
"copyOnSelect": false,

// If enabled, formatted data is also copied to your clipboard
"copyFormatting": false,

// A profile specifies a command to execute paired with information about how it should look and feel.
// Each one of them will appear in the 'New Tab' dropdown,
// and can be invoked from the commandline with `wt.exe -p xxx`
Expand Down
25 changes: 21 additions & 4 deletions src/types/UiaTextRangeBase.cpp
Expand Up @@ -227,8 +227,17 @@ try
// get the values of our endpoint
const auto mine = GetEndpoint(endpoint);

// TODO GH#5406: create a different UIA parent object for each TextBuffer
// This is a temporary solution to comparing two UTRs from different TextBuffers
// Ensure both endpoints fit in the current buffer.
const auto bufferSize = _pData->GetTextBuffer().GetSize();
if (!bufferSize.IsInBounds(mine, true) || !bufferSize.IsInBounds(other, true))
{
return E_FAIL;
}

// compare them
*pRetVal = _pData->GetTextBuffer().GetSize().CompareInBounds(mine, other, true);
*pRetVal = bufferSize.CompareInBounds(mine, other, true);

UiaTracing::TextRange::CompareEndpoints(*this, endpoint, *range, targetEndpoint, *pRetVal);
return S_OK;
Expand Down Expand Up @@ -654,6 +663,17 @@ try
return E_INVALIDARG;
}

// TODO GH#5406: create a different UIA parent object for each TextBuffer
// This is a temporary solution to comparing two UTRs from different TextBuffers
// Ensure both endpoints fit in the current buffer.
const auto bufferSize = _pData->GetTextBuffer().GetSize();
const auto mine = GetEndpoint(endpoint);
const auto other = range->GetEndpoint(targetEndpoint);
if (!bufferSize.IsInBounds(mine, true) || !bufferSize.IsInBounds(other, true))
{
return E_FAIL;
}

SetEndpoint(endpoint, range->GetEndpoint(targetEndpoint));

UiaTracing::TextRange::MoveEndpointByRange(endpoint, *range, targetEndpoint, *this);
Expand Down Expand Up @@ -772,9 +792,6 @@ CATCH_RETURN();

IFACEMETHODIMP UiaTextRangeBase::GetChildren(_Outptr_result_maybenull_ SAFEARRAY** ppRetVal) noexcept
{
// TODO GitHub #1914: Re-attach Tracing to UIA Tree
//Tracing::s_TraceUia(this, ApiCall::GetChildren, nullptr);

RETURN_HR_IF(E_INVALIDARG, ppRetVal == nullptr);

// we don't have any children
Expand Down

0 comments on commit 008d1ba

Please sign in to comment.