@@ -40,7 +40,7 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
4040 /// value is true, and `isEditable` is false, the editor is selectable but not editable.
4141 /// - letterSpacing: The amount of space to use between letters, as a percent. Eg: `1.0` = no space, `1.5` = 1/2 a
4242 /// character's width between characters, etc. Defaults to `1.0`
43- /// - bracketPairHighlight : The type of highlight to use to highlight bracket pairs.
43+ /// - bracketPairEmphasis : The type of highlight to use to highlight bracket pairs.
4444 /// See `BracketPairHighlight` for more information. Defaults to `nil`
4545 /// - useSystemCursor: If true, uses the system cursor on `>=macOS 14`.
4646 /// - undoManager: The undo manager for the text view. Defaults to `nil`, which will create a new CEUndoManager
@@ -62,7 +62,7 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
6262 isEditable: Bool = true ,
6363 isSelectable: Bool = true ,
6464 letterSpacing: Double = 1.0 ,
65- bracketPairHighlight : BracketPairHighlight ? = nil ,
65+ bracketPairEmphasis : BracketPairEmphasis ? = . flash ,
6666 useSystemCursor: Bool = true ,
6767 undoManager: CEUndoManager ? = nil ,
6868 coordinators: [ any TextViewCoordinator ] = [ ]
@@ -83,7 +83,7 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
8383 self . isEditable = isEditable
8484 self . isSelectable = isSelectable
8585 self . letterSpacing = letterSpacing
86- self . bracketPairHighlight = bracketPairHighlight
86+ self . bracketPairEmphasis = bracketPairEmphasis
8787 if #available( macOS 14 , * ) {
8888 self . useSystemCursor = useSystemCursor
8989 } else {
@@ -116,8 +116,8 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
116116 /// value is true, and `isEditable` is false, the editor is selectable but not editable.
117117 /// - letterSpacing: The amount of space to use between letters, as a percent. Eg: `1.0` = no space, `1.5` = 1/2 a
118118 /// character's width between characters, etc. Defaults to `1.0`
119- /// - bracketPairHighlight : The type of highlight to use to highlight bracket pairs.
120- /// See `BracketPairHighlight ` for more information. Defaults to `nil`
119+ /// - bracketPairEmphasis : The type of highlight to use to highlight bracket pairs.
120+ /// See `BracketPairEmphasis ` for more information. Defaults to `nil`
121121 /// - undoManager: The undo manager for the text view. Defaults to `nil`, which will create a new CEUndoManager
122122 /// - coordinators: Any text coordinators for the view to use. See ``TextViewCoordinator`` for more information.
123123 public init (
@@ -137,7 +137,7 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
137137 isEditable: Bool = true ,
138138 isSelectable: Bool = true ,
139139 letterSpacing: Double = 1.0 ,
140- bracketPairHighlight : BracketPairHighlight ? = nil ,
140+ bracketPairEmphasis : BracketPairEmphasis ? = . flash ,
141141 useSystemCursor: Bool = true ,
142142 undoManager: CEUndoManager ? = nil ,
143143 coordinators: [ any TextViewCoordinator ] = [ ]
@@ -158,7 +158,7 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
158158 self . isEditable = isEditable
159159 self . isSelectable = isSelectable
160160 self . letterSpacing = letterSpacing
161- self . bracketPairHighlight = bracketPairHighlight
161+ self . bracketPairEmphasis = bracketPairEmphasis
162162 if #available( macOS 14 , * ) {
163163 self . useSystemCursor = useSystemCursor
164164 } else {
@@ -184,7 +184,7 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
184184 private var isEditable : Bool
185185 private var isSelectable : Bool
186186 private var letterSpacing : Double
187- private var bracketPairHighlight : BracketPairHighlight ?
187+ private var bracketPairEmphasis : BracketPairEmphasis ?
188188 private var useSystemCursor : Bool
189189 private var undoManager : CEUndoManager ?
190190 package var coordinators : [ any TextViewCoordinator ]
@@ -210,7 +210,7 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
210210 isSelectable: isSelectable,
211211 letterSpacing: letterSpacing,
212212 useSystemCursor: useSystemCursor,
213- bracketPairHighlight : bracketPairHighlight ,
213+ bracketPairEmphasis : bracketPairEmphasis ,
214214 undoManager: undoManager,
215215 coordinators: coordinators
216216 )
@@ -309,7 +309,9 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
309309 controller. setHighlightProviders ( highlightProviders)
310310 }
311311
312- controller. bracketPairHighlight = bracketPairHighlight
312+ if controller. bracketPairEmphasis != bracketPairEmphasis {
313+ controller. bracketPairEmphasis = bracketPairEmphasis
314+ }
313315 }
314316
315317 /// Checks if the controller needs updating.
@@ -329,7 +331,7 @@ public struct CodeEditSourceEditor: NSViewControllerRepresentable {
329331 controller. indentOption == indentOption &&
330332 controller. tabWidth == tabWidth &&
331333 controller. letterSpacing == letterSpacing &&
332- controller. bracketPairHighlight == bracketPairHighlight &&
334+ controller. bracketPairEmphasis == bracketPairEmphasis &&
333335 controller. useSystemCursor == useSystemCursor &&
334336 areHighlightProvidersEqual ( controller: controller)
335337 }
@@ -359,7 +361,7 @@ public struct CodeEditTextView: View {
359361 isEditable: Bool = true ,
360362 isSelectable: Bool = true ,
361363 letterSpacing: Double = 1.0 ,
362- bracketPairHighlight : BracketPairHighlight ? = nil ,
364+ bracketPairEmphasis : BracketPairEmphasis ? = nil ,
363365 undoManager: CEUndoManager ? = nil ,
364366 coordinators: [ any TextViewCoordinator ] = [ ]
365367 ) {
0 commit comments