fix invisible text and caret by setting typingAttributes explicitly
This commit is contained in:
parent
1d5e7b7c0e
commit
d31af7f816
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue