@@ -139,21 +139,6 @@ public struct Snapshot: BidirectionalCollection, RangeReplaceableCollection {
139139 }
140140}
141141
142- //=----------------------------------------------------------------------------=
143- // MARK: + Conversions
144- //=----------------------------------------------------------------------------=
145-
146- extension Snapshot : CustomStringConvertible {
147-
148- //=------------------------------------------------------------------------=
149- // MARK: Description
150- //=------------------------------------------------------------------------=
151-
152- @inlinable public var description : String {
153- " \( Self . self) ( \" \( _characters) \" , \( _attributes) ) "
154- }
155- }
156-
157142//=----------------------------------------------------------------------------=
158143// MARK: + Transformations
159144//=----------------------------------------------------------------------------=
@@ -239,9 +224,26 @@ public extension Snapshot {
239224 }
240225}
241226
227+ //=----------------------------------------------------------------------------=
228+ // MARK: + Conversions
229+ //=----------------------------------------------------------------------------=
230+
231+ extension Snapshot : CustomStringConvertible {
232+
233+ //=------------------------------------------------------------------------=
234+ // MARK: Description
235+ //=------------------------------------------------------------------------=
236+
237+ @inlinable public var description : String {
238+ " \( Self . self) ( \" \( _characters) \" , \( _attributes) ) "
239+ }
240+ }
241+
242242//=----------------------------------------------------------------------------=
243243// MARK: + Accessors
244244//=----------------------------------------------------------------------------=
245+ // All extensions below this line are internal implementation details.
246+ //=----------------------------------------------------------------------------=
245247
246248extension Snapshot {
247249
@@ -328,6 +330,17 @@ extension Snapshot {
328330 // MARK: Forwards / Backwards / To / Through
329331 //=--------------------------------------------------------------------=
330332
333+
334+ @inlinable func caret( from index: Index , towards direction: Direction ,
335+ jumping distance: Jump , targeting target: Target ) -> Index ? {
336+ switch ( direction, distance) {
337+ case ( . forwards, . to ) : return caret ( from: index, forwardsTo: target)
338+ case ( . forwards, . through) : return caret ( from: index, forwardsThrough: target)
339+ case ( . backwards, . to ) : return caret ( from: index, backwardsTo: target)
340+ case ( . backwards, . through) : return caret ( from: index, backwardsThrough: target)
341+ }
342+ }
343+
331344 @inlinable func caret( from index: Index , forwardsTo target: Target ) -> Index ? {
332345 indices [ index... ] . first ( where: target)
333346 }
@@ -344,16 +357,6 @@ extension Snapshot {
344357 indices [ ..< index] . last ( where: target)
345358 }
346359
347- @inlinable func caret( from index: Index , towards direction: Direction ,
348- jumping distance: Jump , targeting target: Target ) -> Index ? {
349- switch ( direction, distance) {
350- case ( . forwards, . to ) : return caret ( from: index, forwardsTo: target)
351- case ( . forwards, . through) : return caret ( from: index, forwardsThrough: target)
352- case ( . backwards, . to ) : return caret ( from: index, backwardsTo: target)
353- case ( . backwards, . through) : return caret ( from: index, backwardsThrough: target)
354- }
355- }
356-
357360 //=------------------------------------------------------------------------=
358361 // MARK: Peek
359362 //=------------------------------------------------------------------------=
@@ -371,7 +374,7 @@ extension Snapshot {
371374 }
372375
373376 //=------------------------------------------------------------------------=
374- // MARK: Accessors
377+ // MARK: Passthrough
375378 //=------------------------------------------------------------------------=
376379
377380 @inlinable func nonpassthrough( at index: Index ) -> Bool {
0 commit comments