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 @@ -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
You can’t perform that action at this time.
0 commit comments