Skip to content

Commit

Permalink
Allow TextLocation to be created
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldeicaza committed May 8, 2024
1 parent 36d91bf commit efc560b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/Runestone/TextView/Navigation/TextLocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ public struct TextLocation: Hashable, Equatable {
/// Column in the line.
public let column: Int

/// Initializes TextLocation from the given line and column
public init (lineNumber: Int, column: Int) {
self.lineNumber = lineNumber
self.column = column
}

Check failure on line 15 in Sources/Runestone/TextView/Navigation/TextLocation.swift

View workflow job for this annotation

GitHub Actions / SwiftLint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
init(_ linePosition: LinePosition) {
self.lineNumber = linePosition.row
self.column = linePosition.column
Expand Down

0 comments on commit efc560b

Please sign in to comment.