Skip to content

Commit 7b2cc7f

Browse files
committed
Fixed size menu item layout and updated readme.
1 parent 2f3dbfb commit 7b2cc7f

File tree

4 files changed

+35
-30
lines changed

4 files changed

+35
-30
lines changed

README.md

+16-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
# SCXcodeMinimap v2.0
1+
# SCXcodeMinimap v2.2
22
SCXcodeMiniMap is a Xcode plugin that adds a source editor Minimap to Xcode.
33

4-
Version 2.0 has been rewritten from the ground up to address performance issues (delays on large source files - 1000+ lines) and for creating a better base to build upon. As such, the following new features are now supported:
4+
#### Features
55

6-
#### New Features
7-
- Faster syntax highlighting
8-
- Shows code foldings
9-
- Comment and preprocessor directive highlighting
10-
- Breakpoint highlighting
11-
- All highlighting options are also available for the main Xcode editor
6+
- Custom size
127
- Custom themes
13-
- All options are accessible from the View/Minimap menu item
8+
- Can hide the main editor scroller
9+
- Show code foldings
10+
- Highlights comments and preprocessor directives
11+
- Highlights breakpoints
12+
- Highlights build errors and warnings
13+
- Hihglights Xcode's "instances of selected symbol" (Preferences/Text Editing)
14+
- All these highlighting options are also available for the main editor
15+
16+
All options are configurable through the View/Minimap menu item
1417

1518
#### Screenshots
1619
Without editor highlighting | With editor highlighting
1720
:--------------------------:|:--------------------------:
18-
![](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/v2.0/SCXcodeMinimap%20v2.0-01.png) | ![](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/v2.0/SCXcodeMinimap%20v2.0-03.png) |
19-
![](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/v2.0/SCXcodeMinimap%20v2.0-02.png) | ![](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/v2.0/SCXcodeMinimap%20v2.0-04.png) |
21+
![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-01.png) | ![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-03.png) |
22+
![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-02.png) | ![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-04.png) |
23+
24+
![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/selectedSymbolInstancesHighlighting.gif)
2025

2126
#### Installation
2227
- Through [Alcatraz](https://github.com/supermarin/Alcatraz)

SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ + (void)load
2121
}
2222

2323
- (id<DBGBreakpointAnnotationProviderDelegate>)minimapDelegate
24-
{
24+
{
2525
return objc_getAssociatedObject(self, @selector(minimapDelegate));
2626
}
2727

SCXcodeMinimap/SCXcodeMinimap.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ - (void)createMenuItem
129129

130130
[minimapMenu addItem:[NSMenuItem separatorItem]];
131131

132-
NSView *sizeView = [[NSView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 200.0f, 20.0f)];
132+
NSView *sizeView = [[NSView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 225.0f, 20.0f)];
133133
[sizeView setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewMinYMargin | NSViewMaxYMargin];
134134

135-
NSTextField *sizeViewTitleLabel = [[NSTextField alloc] initWithFrame:NSMakeRect(18.0f, 0.0f, 50.0f, 20.0f)];
135+
NSTextField *sizeViewTitleLabel = [[NSTextField alloc] initWithFrame:NSMakeRect(20.0f, 0.0f, 50.0f, 20.0f)];
136136
[sizeViewTitleLabel setStringValue:kSizeMenuItemTitle];
137137
[sizeViewTitleLabel setFont:[NSFont systemFontOfSize:14]];
138138
[sizeViewTitleLabel setBezeled:NO];
@@ -141,7 +141,7 @@ - (void)createMenuItem
141141
[sizeViewTitleLabel setSelectable:NO];
142142
[sizeView addSubview:sizeViewTitleLabel];
143143

144-
NSSlider *sizeSlider = [[NSSlider alloc] initWithFrame:CGRectMake(60.0f, 0.0f, 136.0f, 20.0f)];
144+
NSSlider *sizeSlider = [[NSSlider alloc] initWithFrame:CGRectMake(60.0f, 0.0f, 156.0f, 20.0f)];
145145
[sizeSlider setMaxValue:0.35f];
146146
[sizeSlider setMinValue:0.05f];
147147
[sizeSlider setTarget:self];

SCXcodeMinimap/SCXcodeMinimapView.m

+15-15
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ @interface SCXcodeMinimapView () < NSLayoutManagerDelegate,
9696
@implementation SCXcodeMinimapView
9797

9898
- (void)dealloc
99-
{
99+
{
100100
for(id observer in self.notificationObservers) {
101101
[[NSNotificationCenter defaultCenter] removeObserver:observer];
102102
}
@@ -113,7 +113,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor
113113
self.editor = editor;
114114

115115
self.editorTextView = editor.textView;
116-
116+
117117
[self setWantsLayer:YES];
118118
[self setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin | NSViewWidthSizable | NSViewHeightSizable];
119119

@@ -251,10 +251,10 @@ - (void)viewDidMoveToWindow
251251
if(self.window == nil) {
252252
return;
253253
}
254-
255-
dispatch_async(dispatch_get_main_queue(), ^{
256-
[self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]];
257-
});
254+
255+
dispatch_async(dispatch_get_main_queue(), ^{
256+
[self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]];
257+
});
258258
}
259259

260260
#pragma mark - Show/Hide
@@ -265,7 +265,7 @@ - (void)setVisible:(BOOL)visible
265265

266266
[self updateSize];
267267

268-
[self.textView.layoutManager setDelegate:(self.hidden ? nil : self)];
268+
[self.textView.layoutManager setDelegate:(self.hidden ? nil : self)];
269269
[self.textView.layoutManager setBackgroundLayoutEnabled:YES];
270270
[self.textView.layoutManager setAllowsNonContiguousLayout:YES];
271271

@@ -301,7 +301,7 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager
301301
[self delayedInvalidateDisplayForVisibleRange];
302302
return @{NSForegroundColorAttributeName : theme.sourcePlainTextColor};
303303
}
304-
304+
305305
if(self.shouldAllowFullSyntaxHighlight) {
306306

307307
if(self.highlightedSymbolDictionaries.count) {
@@ -455,8 +455,8 @@ - (void)updateBreakpointsAndIssuesWithCompletion:(void(^)())completion
455455
for(DBGBreakpointAnnotation *breakpointAnnotation in weakSelf.breakpointAnnotationProvider.annotations) {
456456
if(breakpointAnnotation.paragraphRange.location == lineNumber) {
457457
[weakSelf.breakpointsDictionaries addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:lineRange],
458-
kAnnotationEnabledKey : @(breakpointAnnotation.enabled),
459-
kAnnotationTypeKey : @(SCXcodeMinimapAnnotationTypeBreakpoint)}];
458+
kAnnotationEnabledKey : @(breakpointAnnotation.enabled),
459+
kAnnotationTypeKey : @(SCXcodeMinimapAnnotationTypeBreakpoint)}];
460460
}
461461
}
462462
}
@@ -473,7 +473,7 @@ - (void)updateBreakpointsAndIssuesWithCompletion:(void(^)())completion
473473
}
474474

475475
[weakSelf.issuesDictionaries addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:lineRange],
476-
kAnnotationTypeKey : @(annotationType)}];
476+
kAnnotationTypeKey : @(annotationType)}];
477477
}
478478
}
479479
}
@@ -588,7 +588,7 @@ - (void)handleMouseEvent:(NSEvent *)theEvent
588588
- (void)updateTheme
589589
{
590590
self.editorTheme = [SCXcodeMinimapTheme minimapThemeWithTheme:[DVTFontAndColorTheme currentTheme]];
591-
591+
592592
DVTPreferenceSetManager *preferenceSetManager = [DVTFontAndColorTheme preferenceSetsManager];
593593
NSArray *preferenceSet = [preferenceSetManager availablePreferenceSets];
594594

@@ -614,9 +614,9 @@ - (void)updateTheme
614614
- (void)updateSize
615615
{
616616
CGFloat zoomLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapZoomLevelKey] doubleValue];
617-
617+
618618
CGFloat minimapWidth = (self.hidden ? 0.0f : self.editor.containerView.bounds.size.width * zoomLevel);
619-
619+
620620
NSRect editorScrollViewFrame = self.editor.scrollView.frame;
621621
editorScrollViewFrame.size.width = self.editor.scrollView.superview.frame.size.width - minimapWidth;
622622
self.editor.scrollView.frame = editorScrollViewFrame;
@@ -626,7 +626,7 @@ - (void)updateSize
626626
CGRect frame = self.textView.bounds;
627627
frame.size.width = CGRectGetWidth(self.editorTextView.bounds);
628628
[self.textView setFrame:frame];
629-
629+
630630
CGFloat actualZoomLevel = CGRectGetWidth(self.bounds) / CGRectGetWidth(self.editor.textView.bounds);
631631
[self.scrollView setMagnification:actualZoomLevel];
632632

0 commit comments

Comments
 (0)