Use a non-null identifier when creating new tabs.

This commit is contained in:
Josh Petrie
2015-10-12 17:57:59 -07:00
committed by Josh Petrie
parent c7fad5c260
commit eb6668f805
+4 -1
View File
@@ -396,7 +396,10 @@ enum {
// which tab should be selected at all times. However, the AppKit will
// automatically select the first tab added to a tab view.
NSTabViewItem *tvi = [[NSTabViewItem alloc] initWithIdentifier:nil];
// The documentation claims initWithIdentifier can be given a nil identifier, but the API itself
// is decorated such that doing so produces a warning, so the tab count is used as identifier.
NSInteger identifier = [[self tabView] numberOfTabViewItems];
NSTabViewItem *tvi = [[NSTabViewItem alloc] initWithIdentifier:[NSNumber numberWithInt:identifier]];
// NOTE: If this is the first tab it will be automatically selected.
vimTaskSelectedTab = YES;