File tree Expand file tree Collapse file tree 5 files changed +11
-10
lines changed
Expand file tree Collapse file tree 5 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 2020///
2121/// **Selection**
2222///
23- /// Selection is done by differentiation, but it can also be done manually. It
24- /// may be appropriate on snapshots containing only formatting characters. A pattern
25- /// text style can manually select its first placeholder character, for example.
23+ /// Selection is done by differentiation, but it can also be done manually.
24+ /// Snapshots containing only passthrough characters should always provide
25+ /// a manual selection, however. A pattern text style may select its first
26+ /// placeholder, as illustrated:
2627///
2728/// ```
28- /// ↓ == selection
29+ /// ↓ == selection
2930/// |+|#|#|_|(|#|#|#|)|_|#|#|#|-|#|#|-|#|#|~
3031/// |x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|~
3132/// ```
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public struct PrefixTextStyle<Base: DiffableTextStyle>: WrapperTextStyle {
4949 }
5050
5151 //=------------------------------------------------------------------------=
52- // MARK: Utilities
52+ // MARK: Helpers
5353 //=------------------------------------------------------------------------=
5454
5555 @inlinable func label( _ text: inout String ) {
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public struct SuffixTextStyle<Base: DiffableTextStyle>: WrapperTextStyle {
4949 }
5050
5151 //=------------------------------------------------------------------------=
52- // MARK: Utilities
52+ // MARK: Helpers
5353 //=------------------------------------------------------------------------=
5454
5555 @inlinable func label( _ text: inout String ) {
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ extension Placeholders {
7373
7474 //=--------------------------------------------------------------------=
7575
76- @usableFromInline let elements : ( character : Character , predicate : Predicate )
76+ @usableFromInline let elements : ( Character , Predicate )
7777
7878 //=--------------------------------------------------------------------=
7979
@@ -82,11 +82,11 @@ extension Placeholders {
8282 }
8383
8484 @inlinable subscript( character: Character ) -> Predicate ? {
85- elements. character == character ? elements. predicate : nil
85+ elements. 0 == character ? elements. 1 : nil
8686 }
8787
8888 @inlinable static func == ( lhs: Self , rhs: Self ) -> Bool {
89- lhs. elements. character == rhs. elements. character
89+ lhs. elements. 0 == rhs. elements. 0
9090 }
9191 }
9292
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ extension PatternTextStyle {
109109
110110 /// - Mismatches are removed.
111111 @inlinable public func interpret( _ value: Value , with cache: inout Void ) -> Commit < Value > {
112- reduce ( with: value, into: Commit ( ) ) {
112+ reduce ( with: value, into: Commit ( ) ) {
113113 commit, virtuals, nonvirtual in
114114 commit. snapshot. append ( contentsOf: virtuals, as: . phantom)
115115 commit. snapshot. append ( nonvirtual)
You can’t perform that action at this time.
0 commit comments