diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index 4b1cba8fa73..7b0ae85dfb2 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -1208,6 +1208,14 @@ namespace winrt::TerminalApp::implementation // - Sets focus to the tab to the right or left the currently selected tab. void TerminalPage::_SelectNextTab(const bool bMoveRight) { + if (CommandPalette().Visibility() == Visibility::Visible) + { + // If the tab switcher is currently open, don't change its mode. + // Just select the new tab. + CommandPalette().SelectNextItem(bMoveRight); + return; + } + const auto tabSwitchMode = _settings.GlobalSettings().TabSwitcherMode(); const bool useInOrderTabIndex = tabSwitchMode != TabSwitcherMode::MostRecentlyUsed; @@ -1252,19 +1260,10 @@ namespace winrt::TerminalApp::implementation CommandPalette().SetTabActions(_mruTabActions, true); } - if (CommandPalette().Visibility() == Visibility::Visible) - { - // If the tab switcher is currently open, don't change its mode. - // Just select the new tab. - CommandPalette().SelectNextItem(bMoveRight); - } - else - { - // Otherwise, set up the tab switcher in the selected mode, with - // the given ordering, and make it visible. - CommandPalette().EnableTabSwitcherMode(false, newTabIndex); - CommandPalette().Visibility(Visibility::Visible); - } + // Otherwise, set up the tab switcher in the selected mode, with + // the given ordering, and make it visible. + CommandPalette().EnableTabSwitcherMode(false, newTabIndex); + CommandPalette().Visibility(Visibility::Visible); } else if (auto index{ _GetFocusedTabIndex() }) {