|
9 | 9 | #import "SCMiniMapView.h" |
10 | 10 | #import "SCXcodeMinimap.h" |
11 | 11 |
|
| 12 | +const CGFloat kDefaultZoomLevel = 0.1f; |
| 13 | +static const CGFloat kDefaultShadowLevel = 0.1f; |
| 14 | + |
12 | 15 | static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; |
13 | 16 |
|
14 | 17 | @interface SCMiniMapView () |
@@ -184,18 +187,21 @@ - (void)updateTextView |
184 | 187 | return; |
185 | 188 | } |
186 | 189 |
|
| 190 | + __block NSMutableParagraphStyle *style; |
| 191 | + |
187 | 192 | [mutableAttributedString enumerateAttribute:NSParagraphStyleAttributeName |
188 | 193 | inRange:NSMakeRange(0, mutableAttributedString.length) |
189 | 194 | options:0 |
190 | 195 | 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 | + }]; |
197 | 199 |
|
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)]; |
199 | 205 |
|
200 | 206 | [self.textView.textStorage setAttributedString:mutableAttributedString]; |
201 | 207 | } |
|
0 commit comments