Skip to content

Commit

Permalink
Allow TextLocation to be created (#372)
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldeicaza committed May 13, 2024
1 parent 36d91bf commit 81e23a9
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
}

init(_ linePosition: LinePosition) {
self.lineNumber = linePosition.row
self.column = linePosition.column
Expand Down

0 comments on commit 81e23a9

Please sign in to comment.