Skip to content

Commit d9ffca6

Browse files
authored
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
1 parent 01e3fda commit d9ffca6

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/cascadia/TerminalApp/CommandPalette.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -772,14 +772,11 @@ namespace winrt::TerminalApp::implementation
772772
// - <none>
773773
void CommandPalette::UpdateTabIndices(const uint32_t startIdx)
774774
{
775-
if (startIdx != _allTabActions.Size() - 1)
775+
for (auto i = startIdx; i < _allTabActions.Size(); ++i)
776776
{
777-
for (auto i = startIdx; i < _allTabActions.Size(); ++i)
778-
{
779-
auto command = _allTabActions.GetAt(i);
777+
auto command = _allTabActions.GetAt(i);
780778

781-
command.Action().Args().as<implementation::SwitchToTabArgs>()->TabIndex(i);
782-
}
779+
command.Action().Args().as<implementation::SwitchToTabArgs>()->TabIndex(i);
783780
}
784781
}
785782

0 commit comments

Comments
 (0)