@@ -64,7 +64,7 @@ final class LineController {
6464 var kern : CGFloat = 0 {
6565 didSet {
6666 if kern != oldValue {
67- syntaxHighlighter ? . kern = kern
67+ isDefaultAttributesInvalid = true
6868 }
6969 }
7070 }
@@ -240,25 +240,20 @@ private extension LineController {
240240 private func updateDefaultAttributesIfNecessary( ) {
241241 if isDefaultAttributesInvalid {
242242 if let input = createLineSyntaxHighlightInput ( ) {
243- syntaxHighlighter? . setDefaultAttributes ( on: input. attributedString)
243+ let defaultStringAttributes = DefaultStringAttributes (
244+ textColor: theme. textColor,
245+ font: theme. font,
246+ kern: kern,
247+ tabWidth: tabWidth
248+ )
249+ defaultStringAttributes. apply ( to: input. attributedString)
244250 }
245- updateParagraphStyle ( )
246251 isDefaultAttributesInvalid = false
247252 isSyntaxHighlightingInvalid = true
248253 isTypesetterInvalid = true
249254 }
250255 }
251256
252- private func updateParagraphStyle( ) {
253- if let attributedString = attributedString {
254- let paragraphStyle = NSMutableParagraphStyle ( )
255- paragraphStyle. tabStops = [ ]
256- paragraphStyle. defaultTabInterval = tabWidth
257- let range = NSRange ( location: 0 , length: attributedString. length)
258- attributedString. addAttribute ( . paragraphStyle, value: paragraphStyle, range: range)
259- }
260- }
261-
262257 private func updateTypesetterIfNecessary( ) {
263258 if isTypesetterInvalid {
264259 lineFragmentTree. reset ( rootValue: 0 , rootData: LineFragmentNodeData ( lineFragment: nil ) )
0 commit comments