Skip to content

Commit e901894

Browse files
committed
HistoryController: remember location of the split view
1 parent acfa464 commit e901894

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

PBGitHistoryController.m

+10
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ - (void) updateView
180180
[self refresh:nil];
181181
}
182182

183+
- (void)viewLoaded
184+
{
185+
float position = [[NSUserDefaults standardUserDefaults] floatForKey:@"PBGitSplitViewPosition"];
186+
if (position)
187+
[historySplitView setPosition:position ofDividerAtIndex:0];
188+
}
189+
183190
- (NSResponder *)firstResponder;
184191
{
185192
return commitList;
@@ -201,6 +208,9 @@ - (BOOL) hasNonlinearPath
201208

202209
- (void) removeView
203210
{
211+
float position = [[[historySplitView subviews] objectAtIndex:0] frame].size.height;
212+
[[NSUserDefaults standardUserDefaults] setFloat:position forKey:@"PBGitSplitViewPosition"];
213+
[[NSUserDefaults standardUserDefaults] synchronize];
204214
[webView close];
205215
[commitController removeObserver:self forKeyPath:@"selection"];
206216
[treeController removeObserver:self forKeyPath:@"selection"];

0 commit comments

Comments
 (0)