Skip to content

Commit 1a0d503

Browse files
committed
Disable macOS native tabs (introduced in 10.12)
MacVim already has its own tabbing interface and native tabs (configurable in System Preferences) introduce a second layer of tabs which is confusing. MacVim also doesn't behave properly under such circumstances such as rendering artifacts, lacking proper native menu items (e.g. "Move Tab to New Window"), and keyboard shortcuts like Cmd-W don't work. Note that it's currently not a good idea to implement Vim tabs using native tabs since they assume multiple NSWindow instances and assume they can be split off into multiple windows, which Vim doesn't support.
1 parent 8fbb254 commit 1a0d503

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/MacVim/MMAppController.m

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,20 @@ + (void)initialize
182182
CFSTR(""),
183183
kCFPreferencesCurrentApplication);
184184

185+
if ([NSWindow respondsToSelector:@selector(setAllowsAutomaticWindowTabbing:)]) {
186+
// Disable automatic tabbing on 10.12+. MacVim already has its own
187+
// tabbing interface, so we don't want multiple hierarchy of tabs mixing
188+
// native and Vim tabs. MacVim also doesn't work well with native tabs
189+
// right now since it doesn't respond well to the size change, and it
190+
// doesn't show the native menu items (e.g. move tab to new window) in
191+
// all the tabs.
192+
//
193+
// Note: MacVim cannot use macOS native tabs for Vim tabs because Vim
194+
// assumes only one tab can be shown at a time, and it would be hard to
195+
// handle native tab's "move tab to a new window" functionality.
196+
[NSWindow setAllowsAutomaticWindowTabbing:NO];
197+
}
198+
185199
int tabMinWidthKey;
186200
int tabMaxWidthKey;
187201
int tabOptimumWidthKey;

0 commit comments

Comments
 (0)