TabbedComponent::removeTab (index) - assertion

When I remove the last tab from my TabbedComponent, jlimit() throws an assertion because

juce_tabbedButtonBar.cpp - line 300

setCurrentTabIndex (jlimit (0, tabs.size() - 1, oldTabIndex));

… when there are no tabs left, this causes the limit to be between 0 and -1

i would like the user to be able to remove the last tab without being afraid of this ‘unpredictable’ behaviour warned at in jlimit, but i guess i can work around it, just ‘clearing’ the last tab if they try to delete it.

yep, you’ve got a good point there, that’s a useless assertion. How about:

setCurrentTabIndex (jlimit (0, jmax (0, tabs.size() - 1), oldTabIndex));