From 86e19e1434127262a5b451ad19928ffd96d32987 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Sat, 21 Jun 2008 17:30:35 +0200 Subject: [PATCH] Never delete toolbar --- src/MacVim/MMVimController.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/MacVim/MMVimController.m b/src/MacVim/MMVimController.m index ae2480f6..9cc3a314 100644 --- a/src/MacVim/MMVimController.m +++ b/src/MacVim/MMVimController.m @@ -606,7 +606,8 @@ static int MMReceiveQueueCap = 100; - (void)handleMessage:(int)msgid data:(NSData *)data { - //if (msgid != AddMenuMsgID && msgid != AddMenuItemMsgID) + //if (msgid != AddMenuMsgID && msgid != AddMenuItemMsgID && + // msgid != EnableMenuItemMsgID) // NSLog(@"%@ %s%s", [self className], _cmd, MessageStrings[msgid]); if (OpenVimWindowMsgID == msgid) { @@ -1074,10 +1075,9 @@ static int MMReceiveQueueCap = 100; NSString *rootName = [desc objectAtIndex:0]; if ([rootName isEqual:@"ToolBar"]) { if (toolbar) { - if ([desc count] == 1) { - [windowController setToolbar:nil]; - [toolbar release]; toolbar = nil; - } else if ([desc count] == 2) { + // Only remove toolbar items, never actually remove the toolbar + // itself or strange things may happen. + if ([desc count] == 2) { int idx = [toolbar indexOfItemWithItemIdentifier:title]; if (idx != NSNotFound) [toolbar removeItemAtIndex:idx]; -- 2.11.4.GIT