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)
|
applySyntaxHighlighting(to: ts)
|
||||||
ts.endEditing()
|
ts.endEditing()
|
||||||
}
|
}
|
||||||
|
textView.typingAttributes = [
|
||||||
|
.font: Theme.editorFont,
|
||||||
|
.foregroundColor: Theme.current.text
|
||||||
|
]
|
||||||
updateBlockRanges(for: textView)
|
updateBlockRanges(for: textView)
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
|
|
@ -641,10 +645,12 @@ struct EditorTextView: NSViewRepresentable {
|
||||||
textView.selectedRanges = selectedRanges
|
textView.selectedRanges = selectedRanges
|
||||||
updateBlockRanges(for: textView)
|
updateBlockRanges(for: textView)
|
||||||
}
|
}
|
||||||
textView.font = Theme.editorFont
|
|
||||||
textView.textColor = Theme.current.text
|
|
||||||
textView.backgroundColor = Theme.current.base
|
textView.backgroundColor = Theme.current.base
|
||||||
textView.insertionPointColor = Theme.current.text
|
textView.insertionPointColor = Theme.current.text
|
||||||
|
textView.typingAttributes = [
|
||||||
|
.font: Theme.editorFont,
|
||||||
|
.foregroundColor: Theme.current.text
|
||||||
|
]
|
||||||
|
|
||||||
if let ruler = scrollView.verticalRulerView as? LineNumberRulerView {
|
if let ruler = scrollView.verticalRulerView as? LineNumberRulerView {
|
||||||
ruler.evalResults = evalResults
|
ruler.evalResults = evalResults
|
||||||
|
|
@ -672,6 +678,10 @@ struct EditorTextView: NSViewRepresentable {
|
||||||
ts.beginEditing()
|
ts.beginEditing()
|
||||||
applySyntaxHighlighting(to: ts)
|
applySyntaxHighlighting(to: ts)
|
||||||
ts.endEditing()
|
ts.endEditing()
|
||||||
|
tv.typingAttributes = [
|
||||||
|
.font: Theme.editorFont,
|
||||||
|
.foregroundColor: Theme.current.text
|
||||||
|
]
|
||||||
tv.selectedRanges = sel
|
tv.selectedRanges = sel
|
||||||
updateBlockRanges(for: tv)
|
updateBlockRanges(for: tv)
|
||||||
rulerView?.needsDisplay = true
|
rulerView?.needsDisplay = true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue