Skip to content

Commit 0f5ac8d

Browse files
author
Harlan Haskins
committed
Actually add offsets in add(columns:) and add(lines:size:)
1 parent 6b29e2d commit 0f5ac8d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tools/SwiftSyntax/AbsolutePosition.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,19 @@ public final class AbsolutePosition {
2424
}
2525

2626
internal func add(columns: Int) {
27-
print("adding \(columns) column bytes")
2827
self.column += columns
28+
self.utf8Offset += columns
2929
}
3030

3131
internal func add(lines: Int, size: Int) {
32-
print("adding \(lines * size) line bytes")
3332
self.line += lines * size
3433
self.column = 1
34+
self.utf8Offset += lines * size
3535
}
3636

3737
/// Use some text as a reference for adding to the absolute position,
3838
/// taking note of newlines, etc.
3939
internal func add(text: String) {
40-
print("adding text: \(text)")
4140
for char in text {
4241
switch char {
4342
case "\n", "\r\n":

0 commit comments

Comments
 (0)