Remove unnecessary check when updating ATS indices (#7280)

Removes the if-statement in `UpdateTabIndices` that blocks all scenarios where you delete the second to last tab. This fixes the issue where the ATS gets confused about which item in the ListView is associated with which tab.

Closes #7278
This commit is contained in:
Leon Liang 2020-08-13 13:35:29 -07:00 committed by GitHub
parent 01e3fda91b
commit d9ffca6614
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -772,14 +772,11 @@ namespace winrt::TerminalApp::implementation
// - <none>
void CommandPalette::UpdateTabIndices(const uint32_t startIdx)
{
if (startIdx != _allTabActions.Size() - 1)
for (auto i = startIdx; i < _allTabActions.Size(); ++i)
{
for (auto i = startIdx; i < _allTabActions.Size(); ++i)
{
auto command = _allTabActions.GetAt(i);
auto command = _allTabActions.GetAt(i);
command.Action().Args().as<implementation::SwitchToTabArgs>()->TabIndex(i);
}
command.Action().Args().as<implementation::SwitchToTabArgs>()->TabIndex(i);
}
}