mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
- Moved user default keys to MacVim.[h|m] - Renamed user defaults to the same name as their keys (minus "Key" at the end) - Window top left point autosave is now a string instead of a dictionary
git-svn-id: http://macvim.googlecode.com/svn/trunk@121 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
+7
-30
@@ -67,7 +67,6 @@ static float StatusLineHeight = 16.0f;
|
||||
- (void)placeScrollbars;
|
||||
- (void)scroll:(id)sender;
|
||||
- (void)placeViews;
|
||||
- (NSDictionary *)windowAutosaveDict;
|
||||
@end
|
||||
|
||||
|
||||
@@ -585,11 +584,13 @@ NSMutableArray *buildMenuAddress(NSMenu *menu)
|
||||
|
||||
- (void)windowDidMove:(NSNotification *)notification
|
||||
{
|
||||
if (windowAutosaveKey) {
|
||||
NSDictionary *dict = [self windowAutosaveDict];
|
||||
if (dict)
|
||||
[[NSUserDefaults standardUserDefaults]
|
||||
setObject:dict forKey:windowAutosaveKey];
|
||||
if (setupDone && windowAutosaveKey) {
|
||||
NSRect frame = [[self window] frame];
|
||||
NSPoint topLeft = { frame.origin.x, NSMaxY(frame) };
|
||||
NSString *topLeftString = NSStringFromPoint(topLeft);
|
||||
|
||||
[[NSUserDefaults standardUserDefaults]
|
||||
setObject:topLeftString forKey:windowAutosaveKey];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1091,30 +1092,6 @@ NSMutableArray *buildMenuAddress(NSMenu *menu)
|
||||
[self placeScrollbars];
|
||||
}
|
||||
|
||||
- (NSDictionary *)windowAutosaveDict
|
||||
{
|
||||
if (!setupDone)
|
||||
return nil;
|
||||
|
||||
int rows = 0, cols = 0;
|
||||
if (textStorage)
|
||||
[textStorage getMaxRows:&rows columns:&cols];
|
||||
|
||||
NSPoint origin = NSZeroPoint;
|
||||
if (setupDone) {
|
||||
NSRect frame = [[self window] frame];
|
||||
origin = NSMakePoint(frame.origin.x, NSMaxY(frame));
|
||||
}
|
||||
|
||||
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithInt:rows], @"Rows",
|
||||
[NSNumber numberWithInt:cols], @"Columns",
|
||||
[NSNumber numberWithFloat:origin.x], @"x",
|
||||
[NSNumber numberWithFloat:origin.y], @"y", nil];
|
||||
|
||||
return dict;
|
||||
}
|
||||
|
||||
@end // MMWindowController (Private)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user