Skip to content

Commit ef0d9e2

Browse files
committed
Fix selection range parsing when the text cursor is at the very end
1 parent d5f83fa commit ef0d9e2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Tool/Sources/XcodeInspector/SourceEditor.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ public extension SourceEditor {
262262
countE += line.utf16.count
263263
}
264264
if cursorRange.end == .outOfScope {
265+
if range.lowerBound == range.upperBound { return .outOfScope }
265266
cursorRange.end = .init(
266267
line: lines.endIndex - 1,
267268
character: lines.last?.utf16.count ?? 0

0 commit comments

Comments
 (0)