Skip to content

Commit 180bde0

Browse files
authored
Merge pull request #16 from Rminsh/main
Change background of editor based on theme
2 parents 9b888ab + e59cfe0 commit 180bde0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/CodeEditor/UXCodeTextView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ final class UXCodeTextView: UXTextView {
245245
guard let highlightr = highlightr,
246246
highlightr.setTheme(to: newTheme.rawValue),
247247
let theme = highlightr.theme else { return false }
248+
self.backgroundColor = theme.themeBackgroundColor
248249
if let font = theme.codeFont, font !== self.font { self.font = font }
249250
return true
250251
}
@@ -263,6 +264,7 @@ final class UXCodeTextView: UXTextView {
263264
theme.codeFont = theme.codeFont? .withSize(newSize)
264265
theme.boldCodeFont = theme.boldCodeFont? .withSize(newSize)
265266
theme.italicCodeFont = theme.italicCodeFont?.withSize(newSize)
267+
self.backgroundColor = theme.themeBackgroundColor
266268
if let font = theme.codeFont, font !== self.font { self.font = font }
267269
return true
268270
}

0 commit comments

Comments
 (0)