fix: render light palettes with matching appearance
This commit is contained in:
@@ -516,11 +516,17 @@ final class NotesTextView: NSTextView {
|
||||
super.didChangeText()
|
||||
}
|
||||
|
||||
private static let highlighter: Highlighter = {
|
||||
let value = Highlighter()!
|
||||
value.setTheme("atom-one-dark", withFont: "Menlo-Regular", ofSize: 15)
|
||||
return value
|
||||
}()
|
||||
private static let syntaxHighlighter = Highlighter()!
|
||||
private static var highlightedAsLight: Bool?
|
||||
private static var highlighter: Highlighter {
|
||||
let isLight = ThemePalette.isLight
|
||||
if highlightedAsLight != isLight {
|
||||
syntaxHighlighter.setTheme(isLight ? "atom-one-light" : "atom-one-dark",
|
||||
withFont: "Menlo-Regular", ofSize: 15)
|
||||
highlightedAsLight = isLight
|
||||
}
|
||||
return syntaxHighlighter
|
||||
}
|
||||
// ponytail: style all paragraphs; dirty-paragraph styling if large notes make editing slow.
|
||||
func applyDocumentStyle() {
|
||||
guard !styling, let storage = textStorage else { return }
|
||||
|
||||
Reference in New Issue
Block a user