Skip to content

Commit

Permalink
rename now public Direction to StringTraversalDirection
Browse files Browse the repository at this point in the history
  • Loading branch information
DivineDominion committed Jan 22, 2025
1 parent d5a7022 commit e7651a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sources/DeclarativeTextKit/Buffer/Buffer+wordRange.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extension Buffer {
func expanding(
range searchRange: NSRange,
upToCharactersFrom characterSet: CharacterSet,
direction: Direction
direction: StringTraversalDirection
) -> Buffer.Range {
switch direction {
case .upstream:
Expand Down
2 changes: 1 addition & 1 deletion Sources/DeclarativeTextKit/NSRange+expandedToOther.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extension NSRange {
@inlinable
func expanded(
to other: NSRange,
direction: Direction
direction: StringTraversalDirection
) -> NSRange {
precondition(other.location <= self.location && other.endLocation >= self.endLocation, "Expansion requires other range to be larger")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import Foundation

public enum Direction {
public enum StringTraversalDirection {
/// Left-to-right or towards-the-end search in a string.
case downstream
/// Right-to-left or towards-the-beginning search in a string.
Expand All @@ -29,7 +29,7 @@ extension NSString {
@inlinable
public func locationUpToCharacter(
from characterSet: CharacterSet,
direction: Direction,
direction: StringTraversalDirection,
in range: NSRange
) -> Buffer.Location? {
var result: Buffer.Location?
Expand Down

0 comments on commit e7651a1

Please sign in to comment.