Permalink
Browse files

Merge branch 'lion'

  • Loading branch information...
2 parents ec80934 + 9007fe7 commit 62511ccb3784fe76551496093b5c2c8c05292708 @b4winckler committed Jul 27, 2011
View
@@ -3,6 +3,8 @@
src/MacVim/MacVim.xcodeproj/*.mode1
src/MacVim/MacVim.xcodeproj/*.mode1v3
src/MacVim/MacVim.xcodeproj/*.pbxuser
+src/MacVim/MacVim.xcodeproj/project.xcworkspace
+src/MacVim/MacVim.xcodeproj/xcuserdata
src/MacVim/icons/*.pyc
src/MacVim/icons/*.ttf
src/MacVim/icons/*.reg
@@ -16,6 +18,7 @@ src/MacVim/icons/makeicns/makeicns
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.mode1
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.mode1v3
src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/*.pbxuser
+src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/xcuserdata
src/MacVim/PSMTabBarControl/build
src/MacVim/PSMTabBarControl/build
src/MacVim/build
@@ -35,3 +38,4 @@ src/po/*.mo
src/tags
src/xxd/xxd
src/xxd/xxd.dSYM
+src/a.out.dSYM
View
@@ -3308,7 +3308,7 @@ A jump table for the options with a short description can be found at |Q_op|.
XXX: Think about how 'fullscreen' and 'transparency' should interact.
*'fuoptions'* *'fuopt'*
-'fuoptions' 'fuopt' string (default "maxvert")
+'fuoptions' 'fuopt' string (default "maxvert,maxhorz")
global
{not in Vi}
{only in MacVim GUI}
@@ -3328,6 +3328,7 @@ A jump table for the options with a short description can be found at |Q_op|.
number of columns, it is restored to the value it had before
entering fullscreen.
background:color
+ {not supported in Mac OS X native full screen}
When entering fullscreen, 'color' defines the color of the part
of the screen that is not occupied by the Vim control. If
'color' is an 8-digit hexadecimal number preceded by '#',
@@ -3339,15 +3340,15 @@ A jump table for the options with a short description can be found at |Q_op|.
scheme.
Examples:
- Don't change size of Vim when entering fullscreen: >
+ Don't change size when entering fullscreen: >
:set fuoptions=
-< Maximize Vim when entering fullscreen: >
- :set fuoptions=maxvert,maxhorz
-< Maximize Vim only vertically when entering fullscreen, and color the
+< Only maximize vertically when entering fullscreen: >
+ :set fuoptions=maxvert
+< Maximize only vertically when entering fullscreen, and color the
background dark blue: >
:set fuoptions=maxvert,background:#FF003042
-< Don't change the size of Vim when entering fullscreen, and color the
- background like the current text background: >
+< Don't change size when entering fullscreen, and color the background
+ like the current text background: >
:set fuoptions=background:Normal
<
XXX: what if the font size is changed? you probably never want to
View
@@ -1215,7 +1215,7 @@ if has("gui_macvim")
macm Window.Minimize\ All key=<D-M-m> action=miniaturizeAll: alt=YES
macm Window.Zoom key=<D-C-z> action=performZoom:
macm Window.Zoom\ All key=<D-M-C-z> action=zoomAll: alt=YES
- macm Window.Toggle\ Full\ Screen\ Mode key=<D-F>
+ macm Window.Toggle\ Full\ Screen\ Mode key=<D-C-f>
macm Window.Select\ Next\ Tab key=<D-}>
macm Window.Select\ Previous\ Tab key=<D-{>
macm Window.Bring\ All\ To\ Front action=arrangeInFront:
@@ -223,6 +223,7 @@ + (void)initialize
[NSNumber numberWithBool:YES], MMUseInlineImKey,
#endif // INCLUDE_OLD_IM_CODE
[NSNumber numberWithBool:NO], MMSuppressTerminationAlertKey,
+ [NSNumber numberWithBool:YES], MMNativeFullScreenKey,
nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
@@ -241,6 +242,12 @@ - (id)init
{
if (!(self = [super init])) return nil;
+#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
+ // Disable automatic relaunching
+ if ([NSApp respondsToSelector:@selector(disableRelaunchOnLogin)])
+ [NSApp disableRelaunchOnLogin];
+#endif
+
vimControllers = [NSMutableArray new];
cachedVimControllers = [NSMutableArray new];
preloadPid = -1;
@@ -1065,10 +1072,40 @@ - (IBAction)fileOpen:(id)sender
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setAllowsMultipleSelection:YES];
[panel setAccessoryView:showHiddenFilesView()];
+#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6)
+ // NOTE: -[NSOpenPanel runModalForDirectory:file:types:] is deprecated on
+ // 10.7 but -[NSOpenPanel setDirectoryURL:] requires 10.6 so jump through
+ // the following hoops on 10.6+.
+ dir = [dir stringByExpandingTildeInPath];
+ if (dir) {
+ NSURL *dirURL = [NSURL fileURLWithPath:dir isDirectory:YES];
+ if (dirURL)
+ [panel setDirectoryURL:dirURL];
+ }
+
+ NSInteger result = [panel runModal];
+#else
+ NSInteger result = [panel runModalForDirectory:dir file:nil types:nil];
+#endif
+ if (NSOKButton == result) {
+ // NOTE: -[NSOpenPanel filenames] is deprecated on 10.7 so use
+ // -[NSOpenPanel URLs] instead. The downside is that we have to check
+ // that each URL is really a path first.
+ NSMutableArray *filenames = [NSMutableArray array];
+ NSArray *urls = [panel URLs];
+ NSUInteger i, count = [urls count];
+ for (i = 0; i < count; ++i) {
+ NSURL *url = [urls objectAtIndex:i];
+ if ([url isFileURL]) {
+ NSString *path = [url path];
+ if (path)
+ [filenames addObject:path];
+ }
+ }
- int result = [panel runModalForDirectory:dir file:nil types:nil];
- if (NSOKButton == result)
- [self application:NSApp openFiles:[panel filenames]];
+ if ([filenames count] > 0)
+ [self application:NSApp openFiles:filenames];
+ }
}
- (IBAction)selectNextWindow:(id)sender
@@ -1410,7 +1447,7 @@ - (MMVimController *)topmostVimController
// as follows:
//
// 1. Search through ordered windows as determined by NSApp. Unfortunately
- // this method can fail, e.g. if a full screen window is on another
+ // this method can fail, e.g. if a full-screen window is on another
// "Space" (in this case NSApp returns no windows at all), so we have to
// fall back on ...
// 2. Search through all Vim controllers and return the first visible
View
@@ -131,9 +131,9 @@ extern NSTimeInterval MMBalloonEvalInternalDelay;
- (int)lookupColorWithKey:(NSString *)key;
- (BOOL)hasSpecialKeyWithValue:(char_u *)value;
-- (void)enterFullscreen:(int)fuoptions background:(int)bg;
-- (void)leaveFullscreen;
-- (void)setFullscreenBackgroundColor:(int)color;
+- (void)enterFullScreen:(int)fuoptions background:(int)bg;
+- (void)leaveFullScreen;
+- (void)setFullScreenBackgroundColor:(int)color;
- (void)setAntialias:(BOOL)antialias;
View
@@ -1150,27 +1150,27 @@ - (BOOL)hasSpecialKeyWithValue:(char_u *)value
return NO;
}
-- (void)enterFullscreen:(int)fuoptions background:(int)bg
+- (void)enterFullScreen:(int)fuoptions background:(int)bg
{
NSMutableData *data = [NSMutableData data];
[data appendBytes:&fuoptions length:sizeof(int)];
bg = MM_COLOR(bg);
[data appendBytes:&bg length:sizeof(int)];
- [self queueMessage:EnterFullscreenMsgID data:data];
+ [self queueMessage:EnterFullScreenMsgID data:data];
}
-- (void)leaveFullscreen
+- (void)leaveFullScreen
{
- [self queueMessage:LeaveFullscreenMsgID data:nil];
+ [self queueMessage:LeaveFullScreenMsgID data:nil];
}
-- (void)setFullscreenBackgroundColor:(int)color
+- (void)setFullScreenBackgroundColor:(int)color
{
NSMutableData *data = [NSMutableData data];
color = MM_COLOR(color);
[data appendBytes:&color length:sizeof(int)];
- [self queueMessage:SetFullscreenColorMsgID data:data];
+ [self queueMessage:SetFullScreenColorMsgID data:data];
}
- (void)setAntialias:(BOOL)antialias
@@ -1819,6 +1819,7 @@ - (void)insertVimStateMessage
[NSNumber numberWithInt:p_mh], @"p_mh",
[NSNumber numberWithBool:mmta], @"p_mmta",
[NSNumber numberWithInt:numTabs], @"numTabs",
+ [NSNumber numberWithInt:fuoptions_flags], @"fullScreenOptions",
nil];
// Put the state before all other messages.
@@ -14,15 +14,15 @@
@class MMVimView;
-@interface MMFullscreenWindow : NSWindow {
+@interface MMFullScreenWindow : NSWindow {
NSWindow *target;
MMVimView *view;
NSPoint oldPosition;
NSString *oldTabBarStyle;
int options;
int state;
- // These are only valid in fullscreen mode and store pre-fu vim size
+ // These are only valid in full-screen mode and store pre-fu vim size
int nonFuRows, nonFuColumns;
// These store the size vim had right after entering fu mode
@@ -32,14 +32,15 @@
int startFuFlags;
}
-- (MMFullscreenWindow *)initWithWindow:(NSWindow *)t view:(MMVimView *)v
+- (MMFullScreenWindow *)initWithWindow:(NSWindow *)t view:(MMVimView *)v
backgroundColor:(NSColor *)back;
- (void)setOptions:(int)opt;
-- (void)enterFullscreen;
-- (void)leaveFullscreen;
+- (void)enterFullScreen;
+- (void)leaveFullScreen;
- (void)centerView;
- (BOOL)canBecomeKeyWindow;
- (BOOL)canBecomeMainWindow;
+- (void)applicationDidChangeScreenParameters:(NSNotification *)notification;
@end
Oops, something went wrong.

0 comments on commit 62511cc

Please sign in to comment.