Skip to content

Commit

Permalink
Implement formatteer in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
tonisevener committed Dec 14, 2023
1 parent 496f747 commit 38b4eae
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ final class WKSourceEditorTextFrameworkMediator: NSObject {
private(set) var formatters: [WKSourceEditorFormatter] = []
private(set) var boldItalicsFormatter: WKSourceEditorFormatterBoldItalics?
private(set) var templateFormatter: WKSourceEditorFormatterTemplate?
private(set) var referenceFormatter: WKSourceEditorFormatterReference?

var isSyntaxHighlightingEnabled: Bool = true {
didSet {
Expand Down Expand Up @@ -103,11 +104,14 @@ final class WKSourceEditorTextFrameworkMediator: NSObject {

let boldItalicsFormatter = WKSourceEditorFormatterBoldItalics(colors: colors, fonts: fonts)
let templateFormatter = WKSourceEditorFormatterTemplate(colors: colors, fonts: fonts)
let referenceFormatter = WKSourceEditorFormatterReference(colors: colors, fonts: fonts)
self.formatters = [WKSourceEditorFormatterBase(colors: colors, fonts: fonts, textAlignment: viewModel.textAlignment),
templateFormatter,
boldItalicsFormatter]
boldItalicsFormatter,
referenceFormatter]
self.boldItalicsFormatter = boldItalicsFormatter
self.templateFormatter = templateFormatter
self.referenceFormatter = referenceFormatter

if needsTextKit2 {
if #available(iOS 16.0, *) {
Expand Down

0 comments on commit 38b4eae

Please sign in to comment.