Skip to content

Commit d1f56d6

Browse files
committed
Fix Scrolling To Emphasized Ranges, Swift 6 Warning
1 parent 66fb2ed commit d1f56d6

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

Sources/CodeEditTextView/EmphasisManager/EmphasisManager.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,7 @@ public final class EmphasisManager {
351351
guard let textView, !selectableRanges.isEmpty else { return }
352352

353353
textView.selectionManager.setSelectedRanges(selectableRanges)
354-
355-
// Scroll to the first selected range
356-
if let firstRange = selectableRanges.first {
357-
textView.scrollToRange(firstRange)
358-
}
359-
354+
textView.scrollSelectionToVisible()
360355
textView.needsDisplay = true
361356
}
362357
}

Sources/CodeEditTextView/Extensions/NSBezierPath+CGPathFallback.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ extension NSBezierPath {
2424
path.addCurve(to: points[2], control1: points[0], control2: points[1])
2525
case .closePath:
2626
path.closeSubpath()
27-
@unknown default:
27+
default:
2828
continue
2929
}
3030
}

0 commit comments

Comments
 (0)