@@ -235,8 +235,10 @@ - (void)viewDidMoveToWindow
235
235
if (self.window ==nil ) {
236
236
return ;
237
237
}
238
-
239
- [self setVisible: [[[NSUserDefaults standardUserDefaults ]objectForKey: SCXcodeMinimapShouldDisplayKey]boolValue ]];
238
+
239
+ dispatch_async (dispatch_get_main_queue (), ^{
240
+ [self setVisible: [[[NSUserDefaults standardUserDefaults ]objectForKey: SCXcodeMinimapShouldDisplayKey]boolValue ]];
241
+ });
240
242
}
241
243
242
244
#pragma mark - Show/Hide
@@ -536,9 +538,10 @@ - (SCXcodeMinimapTheme *)minimapThemeWithTheme:(DVTFontAndColorTheme *)theme
536
538
- (void )updateSize
537
539
{
538
540
CGFloat zoomLevel = [[[NSUserDefaults standardUserDefaults ]objectForKey: SCXcodeMinimapZoomLevelKey]doubleValue ];
539
-
541
+
540
542
CGFloat minimapWidth = (self.hidden ?0 .0f : self.editor .containerView .bounds .size .width * zoomLevel);
541
-
543
+ NSLog (@" zoomLevel:%f , minimapWidth:%f " , zoomLevel, minimapWidth);
544
+
542
545
NSRect editorScrollViewFrame = self.editor .scrollView .frame ;
543
546
editorScrollViewFrame.size .width = self.editor .scrollView .superview .frame .size .width - minimapWidth;
544
547
self.editor .scrollView .frame = editorScrollViewFrame;