fix: render light palettes with matching appearance

This commit is contained in:
2026-10-22 16:47:58 +02:00
parent 1b171c7b52
commit c0a17f5efe
16 changed files with 467 additions and 27 deletions
+11 -5
View File
@@ -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 }