We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e29dca3 commit eda2e8aCopy full SHA for eda2e8a
1 file changed
Tool/Sources/XcodeInspector/SourceEditor.swift
@@ -202,7 +202,7 @@ public extension SourceEditor {
202
var cursorRange = CursorRange(start: .zero, end: .outOfScope)
203
for (i, line) in lines.enumerated() {
204
// The range is counted in UTF8, which causes line endings like \r\n to be of length 2.
205
- let lineEndingAddition = (line.lineEnding?.utf8.count ?? 1) - 1
+ let lineEndingAddition = line.lineEnding.utf8.count - 1
206
if countS <= range.lowerBound,
207
range.lowerBound < countS + line.count + lineEndingAddition
208
{
0 commit comments