Is there any reason to not use tabView.SelectedIndex()? #1464

Open
opened 2026-01-30 22:28:03 +00:00 by claunia · 0 comments
Owner

Originally created by @Summon528 on GitHub (Jun 1, 2019).

880272c748/src/cascadia/TerminalApp/App.cpp (L632-L639)

Upon investigating #1074 & #1038, I was wondering if there is any reason that we are going through all the hassle of finding the correct tabViewItem from vector tabs instead of just something like

    void App::_SetFocusedTabIndex(int tabIndex)
    {
        _tabView.SelectedIndex(tabIndex);
    }

I guess the diffrence is that I use the index from _tabView.Item() instead, but does tabs and _tabView.Items() ever get out of sync?

Originally created by @Summon528 on GitHub (Jun 1, 2019). <!-- Briefly describe which document needs to be corrected and why. --> https://github.com/microsoft/terminal/blob/880272c7483a3bb6893dbec3725d0eb7375ab78a/src/cascadia/TerminalApp/App.cpp#L632-L639 Upon investigating #1074 & #1038, I was wondering if there is any reason that we are going through all the hassle of finding the correct `tabViewItem` from `vector tabs` instead of just something like ```cpp void App::_SetFocusedTabIndex(int tabIndex) { _tabView.SelectedIndex(tabIndex); } ``` I guess the diffrence is that I use the index from `_tabView.Item()` instead, but does `tabs` and `_tabView.Items()` ever get out of sync?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1464