Skip to content

Commit

Permalink
Revert "Revert "Update TerminalTab.cpp""
Browse files Browse the repository at this point in the history
This reverts commit 69787f0.
  • Loading branch information
Swinkid committed Mar 20, 2023
1 parent 2903026 commit 8a8590a
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/cascadia/TerminalApp/TerminalTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1593,28 +1593,10 @@ namespace winrt::TerminalApp::implementation
// the same read-only status.
void TerminalTab::SetPaneReadOnly(const bool readOnlyState)
{
auto hasReadOnly = false;
auto allReadOnly = true;
_activePane->WalkTree([&](const auto& p) {
if (const auto& control{ p->GetTerminalControl() })
{
hasReadOnly |= control.ReadOnly();
allReadOnly &= control.ReadOnly();
}
});
_activePane->WalkTree([&](const auto& p) {
if (const auto& control{ p->GetTerminalControl() })
{
// If all controls have the same read only state then just disable
if (allReadOnly || !hasReadOnly)
{
control.SetReadOnly(readOnlyState);
}
// otherwise set to all read only.
else if (!control.ReadOnly())
{
control.SetReadOnly(readOnlyState);
}
control.SetReadOnly(readOnlyState);
}
});
}
Expand Down

0 comments on commit 8a8590a

Please sign in to comment.