Skip to content

Commit 3e5e6df

Browse files
committed
Update CodeEditSourceEditor.swift
1 parent de0e38d commit 3e5e6df

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Sources/CodeEditSourceEditor/CodeEditSourceEditor/CodeEditSourceEditor.swift

+12-3
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,15 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
253253
return
254254
}
255255

256+
updateControllerParams(controller: controller)
257+
258+
controller.reloadUI()
259+
return
260+
}
261+
262+
/// Update the parameters of the controller.
263+
/// - Parameter controller: The controller to update.
264+
func updateControllerParams(controller: TextViewController) {
256265
if controller.font != font {
257266
controller.font = font
258267
}
@@ -296,11 +305,11 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
296305
}
297306

298307
controller.bracketPairHighlight = bracketPairHighlight
299-
300-
controller.reloadUI()
301-
return
302308
}
303309

310+
/// Checks if the controller needs updating.
311+
/// - Parameter controller: The controller to check.
312+
/// - Returns: True, if the controller's parameters should be updated.
304313
func paramsAreEqual(controller: NSViewControllerType) -> Bool {
305314
controller.font == font &&
306315
controller.isEditable == isEditable &&

0 commit comments

Comments
 (0)