Skip to content

Commit cd0b407

Browse files
committed
Fixes #12
1 parent 0cdb456 commit cd0b407

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

SCXcodeMinimap/SCMiniMapView.m

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,18 @@ - (void)updateTextView
184184
if(mutableAttributedString == nil) {
185185
return;
186186
}
187-
188-
[mutableAttributedString setAttributes:@{NSFontAttributeName: self.font} range:NSMakeRange(0, mutableAttributedString.length)];
187+
188+
__block NSMutableParagraphStyle *style;
189+
[mutableAttributedString enumerateAttribute:NSParagraphStyleAttributeName
190+
inRange:NSMakeRange(0, mutableAttributedString.length)
191+
options:0
192+
usingBlock:^(id value, NSRange range, BOOL *stop) {
193+
style = [value mutableCopy];
194+
}];
195+
[style setTabStops:@[]];
196+
[style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel];
197+
198+
[mutableAttributedString setAttributes:@{NSFontAttributeName: self.font, NSParagraphStyleAttributeName : style} range:NSMakeRange(0, mutableAttributedString.length)];
189199
[self.textView.textStorage setAttributedString:mutableAttributedString];
190200
}
191201

0 commit comments

Comments
 (0)