_tabView.Items() and _tabs should not need to be kept in sync manually #2740
Labels
Area-CodeHealth
Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc.
Issue-Task
It's a feature request, but it doesn't really need a major design.
Needs-Tag-Fix
Doesn't match tag requirements
Product-Terminal
The new Windows Terminal.
Milestone
Right now in TerminalPage, we have two separate vectors of "tabs" that need to be kept in sync:
vector<shared_ptr<Tab>> _tabs
_tabView
of all theTabViewItem
s.This is kinda silly, we should probably just use the
_tabView.Items()
vector, and more closely associate theTab
with them.Case in point is
TerminalPage::_RemoveTabViewItem
, where we need to both remove the tab from both the tabs and the tabView.Items().We could probably make tabs an observable vector or something, so the tabview is inherently tied to the tabs collection. I did a bit of similar prototyping in the command palette prototype, see #2046 for that branch.
The text was updated successfully, but these errors were encountered: