Skip to content

Commit 81e23a9

Browse files
Allow TextLocation to be created (simonbs#372)
1 parent 36d91bf commit 81e23a9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Sources/Runestone/TextView/Navigation/TextLocation.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ public struct TextLocation: Hashable, Equatable {
77
/// Column in the line.
88
public let column: Int
99

10+
/// Initializes TextLocation from the given line and column
11+
public init (lineNumber: Int, column: Int) {
12+
self.lineNumber = lineNumber
13+
self.column = column
14+
}
15+
1016
init(_ linePosition: LinePosition) {
1117
self.lineNumber = linePosition.row
1218
self.column = linePosition.column

0 commit comments

Comments
 (0)