Skip to content

Commit

Permalink
Update CodeEditSourceEditor.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
thecoolwinter committed Jun 16, 2024
1 parent de0e38d commit 3e5e6df
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,15 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
return
}

updateControllerParams(controller: controller)

controller.reloadUI()
return
}

/// Update the parameters of the controller.
/// - Parameter controller: The controller to update.
func updateControllerParams(controller: TextViewController) {
if controller.font != font {
controller.font = font
}
Expand Down Expand Up @@ -296,11 +305,11 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
}

controller.bracketPairHighlight = bracketPairHighlight

controller.reloadUI()
return
}

/// Checks if the controller needs updating.
/// - Parameter controller: The controller to check.
/// - Returns: True, if the controller's parameters should be updated.
func paramsAreEqual(controller: NSViewControllerType) -> Bool {
controller.font == font &&
controller.isEditable == isEditable &&
Expand Down

0 comments on commit 3e5e6df

Please sign in to comment.