diff --git a/src/EditorView.swift b/src/EditorView.swift index 230952a..c3e1123 100644 --- a/src/EditorView.swift +++ b/src/EditorView.swift @@ -618,6 +618,10 @@ struct EditorTextView: NSViewRepresentable { applySyntaxHighlighting(to: ts) ts.endEditing() } + textView.typingAttributes = [ + .font: Theme.editorFont, + .foregroundColor: Theme.current.text + ] updateBlockRanges(for: textView) DispatchQueue.main.async { @@ -641,10 +645,12 @@ struct EditorTextView: NSViewRepresentable { textView.selectedRanges = selectedRanges updateBlockRanges(for: textView) } - textView.font = Theme.editorFont - textView.textColor = Theme.current.text textView.backgroundColor = Theme.current.base textView.insertionPointColor = Theme.current.text + textView.typingAttributes = [ + .font: Theme.editorFont, + .foregroundColor: Theme.current.text + ] if let ruler = scrollView.verticalRulerView as? LineNumberRulerView { ruler.evalResults = evalResults @@ -672,6 +678,10 @@ struct EditorTextView: NSViewRepresentable { ts.beginEditing() applySyntaxHighlighting(to: ts) ts.endEditing() + tv.typingAttributes = [ + .font: Theme.editorFont, + .foregroundColor: Theme.current.text + ] tv.selectedRanges = sel updateBlockRanges(for: tv) rulerView?.needsDisplay = true