diff --git a/Sources/DiffableTextKit/Models/Field.swift b/Sources/DiffableTextKit/Models/Field.swift index 9d09c876..4f43b984 100644 --- a/Sources/DiffableTextKit/Models/Field.swift +++ b/Sources/DiffableTextKit/Models/Field.swift @@ -68,13 +68,13 @@ extension Field { //=--------------------------------------= // MARK: Single //=--------------------------------------= - let upperBound = layout.index(at: destination.upperBound, start: selection.upperBound) + let upperBound = layout.index(at: destination.upperBound, from: selection.upperBound) var lowerBound = upperBound //=--------------------------------------= // MARK: Double //=--------------------------------------= if !destination.isEmpty { - lowerBound = layout.index(at: destination.lowerBound, start: selection.lowerBound) + lowerBound = layout.index(at: destination.lowerBound, from: selection.lowerBound) } //=--------------------------------------= // MARK: Return diff --git a/Sources/DiffableTextKit/Models/Layout.swift b/Sources/DiffableTextKit/Models/Layout.swift index cc90150a..ac76ea0d 100644 --- a/Sources/DiffableTextKit/Models/Layout.swift +++ b/Sources/DiffableTextKit/Models/Layout.swift @@ -154,7 +154,7 @@ extension Layout { // MARK: Position //=------------------------------------------------------------------------= - @inlinable func index(at position: Position, start: Index) -> Index { + @inlinable func index(at position: Position, from start: Index) -> Index { switch start.position <= position { case true: return index(after: start, while: { $0.position < position }) case false: return index(before: start, while: { $0.position > position }) diff --git a/Sources/DiffableTextKit/Models/Position.swift b/Sources/DiffableTextKit/Models/Position.swift index 545b2b8b..83e9008b 100644 --- a/Sources/DiffableTextKit/Models/Position.swift +++ b/Sources/DiffableTextKit/Models/Position.swift @@ -50,8 +50,8 @@ public struct Position: Comparable, ExpressibleB // MARK: Transformations //=------------------------------------------------------------------------= - @inlinable func after(_ character: Character) -> Self { - Self(offset + Scheme.size(of: character)) + @inlinable func after(_ character: Character) -> Self { + Self(offset + Scheme.size(of: character)) } @inlinable func before(_ character: Character) -> Self {