Skip to content

Commit 9dc1241

Browse files
committed
Fixes #12
1 parent fef38fa commit 9dc1241

File tree

5 files changed

+15
-28
lines changed

5 files changed

+15
-28
lines changed

SCXcodeMinimap.xcodeproj/project.pbxproj

-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
8742532217307161001C947C /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
3030
B25F211A172FE208001A9E6E /* SCMiniMapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCMiniMapView.h; sourceTree = "<group>"; };
3131
B25F211B172FE208001A9E6E /* SCMiniMapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCMiniMapView.m; sourceTree = "<group>"; };
32-
B25F211D172FE3B3001A9E6E /* Conf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Conf.h; sourceTree = "<group>"; };
3332
/* End PBXFileReference section */
3433

3534
/* Begin PBXFrameworksBuildPhase section */
@@ -85,7 +84,6 @@
8584
18FE09BB1707639E00118FEB /* SCXcodeMinimap */ = {
8685
isa = PBXGroup;
8786
children = (
88-
B25F211D172FE3B3001A9E6E /* Conf.h */,
8987
18FE09C7170764E400118FEB /* SCXcodeMinimap.h */,
9088
18FE09C8170764E400118FEB /* SCXcodeMinimap.m */,
9189
B25F211A172FE208001A9E6E /* SCMiniMapView.h */,

SCXcodeMinimap/Conf.h

-18
This file was deleted.

SCXcodeMinimap/SCMiniMapView.h

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#import <Cocoa/Cocoa.h>
1010
#import "SCSelectionView.h"
1111

12+
extern const CGFloat kDefaultZoomLevel;
13+
1214
@interface SCMiniMapView : NSScrollView <NSLayoutManagerDelegate>
1315

1416
@property (nonatomic, strong) NSTextView *textView;

SCXcodeMinimap/SCMiniMapView.m

+13-7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
#import "SCMiniMapView.h"
1010
#import "SCXcodeMinimap.h"
1111

12+
const CGFloat kDefaultZoomLevel = 0.1f;
13+
static const CGFloat kDefaultShadowLevel = 0.1f;
14+
1215
static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification";
1316

1417
@interface SCMiniMapView ()
@@ -184,18 +187,21 @@ - (void)updateTextView
184187
return;
185188
}
186189

190+
__block NSMutableParagraphStyle *style;
191+
187192
[mutableAttributedString enumerateAttribute:NSParagraphStyleAttributeName
188193
inRange:NSMakeRange(0, mutableAttributedString.length)
189194
options:0
190195
usingBlock:^(id value, NSRange range, BOOL *stop) {
191-
192-
NSMutableParagraphStyle *style = [value mutableCopy];
193-
[style setTabStops:@[]];
194-
[style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel];
195-
[mutableAttributedString addAttributes:@{NSParagraphStyleAttributeName:style} range:range];
196-
}];
196+
style = [value mutableCopy];
197+
*stop = YES;
198+
}];
197199

198-
[mutableAttributedString setAttributes:@{NSFontAttributeName: self.font} range:NSMakeRange(0, mutableAttributedString.length)];
200+
201+
[style setTabStops:@[]];
202+
[style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel];
203+
204+
[mutableAttributedString setAttributes:@{NSFontAttributeName: self.font, NSParagraphStyleAttributeName : style} range:NSMakeRange(0, mutableAttributedString.length)];
199205

200206
[self.textView.textStorage setAttributedString:mutableAttributedString];
201207
}

SCXcodeMinimap/SCXcodeMinimap-Prefix.pch

-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
#ifdef __OBJC__
66
#import <Cocoa/Cocoa.h>
7-
#import "Conf.h"
87
#endif

0 commit comments

Comments
 (0)