File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -191,8 +191,18 @@ - (void)updateTextView
191191 if (mutableAttributedString == nil ) {
192192 return ;
193193 }
194-
195- [mutableAttributedString setAttributes: @{NSFontAttributeName : self.font } range: NSMakeRange (0 , mutableAttributedString.length)];
194+
195+ __block NSMutableParagraphStyle *style;
196+ [mutableAttributedString enumerateAttribute: NSParagraphStyleAttributeName
197+ inRange: NSMakeRange (0 , mutableAttributedString.length)
198+ options: 0
199+ usingBlock: ^(id value, NSRange range, BOOL *stop) {
200+ style = [value mutableCopy ];
201+ }];
202+ [style setTabStops: @[]];
203+ [style setDefaultTabInterval: style.defaultTabInterval * kDefaultZoomLevel ];
204+
205+ [mutableAttributedString setAttributes: @{NSFontAttributeName : self.font , NSParagraphStyleAttributeName : style} range: NSMakeRange (0 , mutableAttributedString.length)];
196206 [self .textView.textStorage setAttributedString: mutableAttributedString];
197207 [mutableAttributedString release ];
198208}
You can’t perform that action at this time.
0 commit comments