Skip to content

Commit 038c726

Browse files
committed
Merged 'Xcode5.0' into master.
2 parents 8fb8e2f + 662a5d0 commit 038c726

File tree

7 files changed

+35
-39
lines changed

7 files changed

+35
-39
lines changed

SCXcodeMinimap.xcodeproj/project.pbxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
18FE09AA1707639E00118FEB /* Project object */ = {
133133
isa = PBXProject;
134134
attributes = {
135-
LastUpgradeCheck = 0460;
135+
LastUpgradeCheck = 0500;
136136
ORGANIZATIONNAME = "Stefan Ceriu";
137137
};
138138
buildConfigurationList = 18FE09AD1707639E00118FEB /* Build configuration list for PBXProject "SCXcodeMinimap" */;
@@ -180,7 +180,6 @@
180180
isa = XCBuildConfiguration;
181181
buildSettings = {
182182
ALWAYS_SEARCH_USER_PATHS = NO;
183-
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
184183
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
185184
CLANG_CXX_LIBRARY = "libc++";
186185
CLANG_WARN_CONSTANT_CONVERSION = YES;
@@ -212,7 +211,6 @@
212211
isa = XCBuildConfiguration;
213212
buildSettings = {
214213
ALWAYS_SEARCH_USER_PATHS = NO;
215-
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
216214
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
217215
CLANG_CXX_LIBRARY = "libc++";
218216
CLANG_WARN_CONSTANT_CONVERSION = YES;
@@ -236,10 +234,11 @@
236234
18FE09C51707639E00118FEB /* Debug */ = {
237235
isa = XCBuildConfiguration;
238236
buildSettings = {
237+
CLANG_ENABLE_OBJC_ARC = YES;
239238
COMBINE_HIDPI_IMAGES = YES;
240239
DEPLOYMENT_LOCATION = YES;
241240
DSTROOT = "$(HOME)";
242-
GCC_ENABLE_OBJC_GC = supported;
241+
GCC_ENABLE_OBJC_GC = "";
243242
GCC_PRECOMPILE_PREFIX_HEADER = YES;
244243
GCC_PREFIX_HEADER = "SCXcodeMinimap/SCXcodeMinimap-Prefix.pch";
245244
INFOPLIST_FILE = "SCXcodeMinimap/SCXcodeMinimap-Info.plist";
@@ -252,10 +251,11 @@
252251
18FE09C61707639E00118FEB /* Release */ = {
253252
isa = XCBuildConfiguration;
254253
buildSettings = {
254+
CLANG_ENABLE_OBJC_ARC = YES;
255255
COMBINE_HIDPI_IMAGES = YES;
256256
DEPLOYMENT_LOCATION = YES;
257257
DSTROOT = "$(HOME)";
258-
GCC_ENABLE_OBJC_GC = supported;
258+
GCC_ENABLE_OBJC_GC = "";
259259
GCC_PRECOMPILE_PREFIX_HEADER = YES;
260260
GCC_PREFIX_HEADER = "SCXcodeMinimap/SCXcodeMinimap-Prefix.pch";
261261
INFOPLIST_FILE = "SCXcodeMinimap/SCXcodeMinimap-Info.plist";

SCXcodeMinimap/SCMiniMapView.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
@interface SCMiniMapView : NSScrollView <NSLayoutManagerDelegate>
1313

14-
@property (nonatomic, retain) NSTextView *textView;
15-
@property (nonatomic, retain) SCSelectionView *selectionView;
14+
@property (nonatomic, strong) NSTextView *textView;
15+
@property (nonatomic, strong) SCSelectionView *selectionView;
1616

17-
@property (nonatomic, assign) NSScrollView *editorScrollView;
17+
@property (nonatomic, weak) NSScrollView *editorScrollView;
1818
@property (nonatomic, assign) NSTextView *editorTextView;
1919

2020
- (void)updateTextView;

SCXcodeMinimap/SCMiniMapView.m

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
@interface SCMiniMapView ()
1515

16-
@property (nonatomic, retain) NSColor *backgroundColor;
17-
@property (nonatomic, retain) NSFont *font;
16+
@property (nonatomic, strong) NSColor *backgroundColor;
17+
@property (nonatomic, strong) NSFont *font;
1818

1919
@end
2020

@@ -54,12 +54,6 @@ - (id)initWithFrame:(NSRect)frame
5454
- (void)dealloc
5555
{
5656
[[NSNotificationCenter defaultCenter] removeObserver:self];
57-
58-
[_selectionView release];
59-
[_textView release];
60-
[_backgroundColor release];
61-
[_font release];
62-
[super dealloc];
6357
}
6458

6559
#pragma mark - Lazy Initialization
@@ -73,7 +67,7 @@ - (NSTextView *)textView
7367
[_textView.textContainer setLineFragmentPadding:0.0f];
7468

7569
[_textView.layoutManager setDelegate:self];
76-
70+
7771
[_textView setAllowsUndo:NO];
7872
[_textView setAllowsImageEditing:NO];
7973
[_textView setAutomaticDashSubstitutionEnabled:NO];
@@ -151,9 +145,9 @@ - (void)show
151145
{
152146
self.hidden = NO;
153147

154-
NSRect frame = self.editorScrollView.frame;
155-
frame.size.width = self.editorScrollView.superview.frame.size.width - self.bounds.size.width;
156-
self.editorScrollView.frame = frame;
148+
NSRect editorTextViewFrame = self.editorScrollView.frame;
149+
editorTextViewFrame.size.width = self.editorScrollView.superview.frame.size.width - self.bounds.size.width;
150+
self.editorScrollView.frame = editorTextViewFrame;
157151

158152
[self updateTextView];
159153
[self updateSelectionView];
@@ -163,21 +157,20 @@ - (void)hide
163157
{
164158
self.hidden = YES;
165159

166-
NSRect frame = self.editorScrollView.frame;
167-
frame.size.width = self.editorScrollView.superview.frame.size.width;
168-
self.editorScrollView.frame = frame;
160+
NSRect editorTextViewFrame = self.editorScrollView.frame;
161+
editorTextViewFrame.size.width = self.editorScrollView.superview.frame.size.width;
162+
self.editorScrollView.frame = editorTextViewFrame;
169163
}
170164

171165
#pragma mark - Updating
172166

173167
- (void)updateTheme
174168
{
175169
[self setFont:nil];
176-
[self updateTextView];
177170

178171
[self setBackgroundColor:nil];
179172
[self.selectionView setSelectionColor:nil];
180-
[self.textView setBackgroundColor:self.backgroundColor];
173+
[self.textView setBackgroundColor:self.backgroundColor];
181174
}
182175

183176
- (void)updateTextView
@@ -204,7 +197,6 @@ - (void)updateTextView
204197

205198
[mutableAttributedString setAttributes:@{NSFontAttributeName: self.font, NSParagraphStyleAttributeName : style} range:NSMakeRange(0, mutableAttributedString.length)];
206199
[self.textView.textStorage setAttributedString:mutableAttributedString];
207-
[mutableAttributedString release];
208200
}
209201

210202
- (void)resizeWithOldSuperviewSize:(NSSize)oldSize
@@ -238,15 +230,20 @@ - (void)updateSelectionView
238230
ratio = (textHeight - self.selectionView.bounds.size.height) / editorContentHeight;
239231
selectionViewFrame.origin.y = self.editorScrollView.contentView.bounds.origin.y * ratio;
240232
}
241-
233+
242234
[self.selectionView setFrame:selectionViewFrame];
243235
}
244236

245237
#pragma mark - NSLayoutManagerDelegate
246238

247239
- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinished
248240
{
249-
if(layoutFinished) {
241+
if([layoutManager isEqual:self.editorTextView.layoutManager]) {
242+
[(id<NSLayoutManagerDelegate>)self.editorTextView layoutManager:layoutManager
243+
didCompleteLayoutForTextContainer:textContainer
244+
atEnd:layoutFinished];
245+
}
246+
else if(layoutFinished) {
250247
[self updateSelectionView];
251248
}
252249
}

SCXcodeMinimap/SCSelectionView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
@interface SCSelectionView : NSView
1212

13-
@property (nonatomic, retain) NSColor *selectionColor;
13+
@property (nonatomic, strong) NSColor *selectionColor;
1414
@property (nonatomic, assign) BOOL shouldInverseColors;
1515

1616
@end

SCXcodeMinimap/SCSelectionView.m

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
@implementation SCSelectionView
1212
@synthesize selectionColor = _selectionColor;
1313

14-
- (void)dealloc
15-
{
16-
[self.selectionColor release];
17-
[super dealloc];
18-
}
19-
2014
- (void)drawRect:(NSRect)dirtyRect
2115
{
2216
[[self selectionColor] setFill];

SCXcodeMinimap/SCXcodeMinimap-Info.plist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
2424
<string>1</string>
25+
<key>DVTPlugInCompatibilityUUIDs</key>
26+
<array>
27+
<string>63FC1C47-140D-42B0-BB4D-A10B2D225574</string>
28+
<string>37B30044-3B14-46BA-ABAA-F01000C27B63</string>
29+
</array>
2530
<key>NSHumanReadableCopyright</key>
2631
<string>Copyright © 2013 Stefan Ceriu. All rights reserved.</string>
2732
<key>NSPrincipalClass</key>

SCXcodeMinimap/SCXcodeMinimap.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ - (void)createMenuItem
6363
atIndex:[editMenuItem.submenu numberOfItems]];
6464
[editMenuItem.submenu insertItem:miniMapItem
6565
atIndex:[editMenuItem.submenu numberOfItems]];
66-
67-
[miniMapItem release];
6866

6967
if ([[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]) {
7068
[self hideMiniMap:miniMapItem];
@@ -96,10 +94,14 @@ - (void)showMiniMap:(NSMenuItem *)sender
9694

9795
- (void)onDocumentDidChange:(NSNotification*)sender
9896
{
97+
if ([[[sender object] class] isSubclassOfClass:[NSDocument class]])
98+
{
9999
SCMiniMapView *miniMapView = objc_getAssociatedObject([sender object], &kKeyMiniMapView);
100100
[miniMapView updateTextView];
101101
}
102102

103+
}
104+
103105
- (void)onCodeEditorBoundsChange:(NSNotification*)sender
104106
{
105107
if(![sender.object respondsToSelector:@selector(scrollView)]) {
@@ -161,8 +163,6 @@ - (void)onDidFinishSetup:(NSNotification*)sender
161163
else {
162164
[miniMapView show];
163165
}
164-
165-
[miniMapView release];
166166
}
167167

168168
@end

0 commit comments

Comments
 (0)