File tree 1 file changed +12
-3
lines changed
Sources/CodeEditSourceEditor/CodeEditSourceEditor
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,15 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
253
253
return
254
254
}
255
255
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 ) {
256
265
if controller. font != font {
257
266
controller. font = font
258
267
}
@@ -296,11 +305,11 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
296
305
}
297
306
298
307
controller. bracketPairHighlight = bracketPairHighlight
299
-
300
- controller. reloadUI ( )
301
- return
302
308
}
303
309
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.
304
313
func paramsAreEqual( controller: NSViewControllerType ) -> Bool {
305
314
controller. font == font &&
306
315
controller. isEditable == isEditable &&
You can’t perform that action at this time.
0 commit comments