diff --git a/Package.swift b/Package.swift index 6a1569615..85d32d5a5 100644 --- a/Package.swift +++ b/Package.swift @@ -15,11 +15,11 @@ let package = Package( dependencies: [ .package( url: "https://github.com/krzyzanowskim/STTextView.git", - revision: "897c5ff" + exact: "0.8.7" ), .package( url: "https://github.com/CodeEditApp/CodeEditLanguages.git", - exact: "0.1.16" + exact: "0.1.17" ), .package( url: "https://github.com/lukepistrol/SwiftLintPlugin", @@ -36,7 +36,8 @@ let package = Package( dependencies: [ "STTextView", "CodeEditLanguages", - "TextFormation" + "TextFormation", + .product(name: "STTextKitPlus", package: "STTextView") ], plugins: [ .plugin(name: "SwiftLint", package: "SwiftLintPlugin") diff --git a/Sources/CodeEditTextView/Extensions/NSTextLayoutManager+textLineFragment.swift b/Sources/CodeEditTextView/Extensions/NSTextLayoutManager+textLineFragment.swift deleted file mode 100644 index 139e7c25a..000000000 --- a/Sources/CodeEditTextView/Extensions/NSTextLayoutManager+textLineFragment.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// File.swift -// -// -// Created by Khan Winter on 7/8/23. -// - -import AppKit - -extension NSTextLayoutManager { - func textLineFragment(at location: NSTextLocation) -> NSTextLineFragment? { - textLayoutFragment(for: location)?.textLineFragment(at: location) - } -} - -extension NSTextLayoutFragment { - func textLineFragment( - at location: NSTextLocation, - in textContentManager: NSTextContentManager? = nil - ) -> NSTextLineFragment? { - guard let textContentManager = textContentManager ?? textLayoutManager?.textContentManager else { - assertionFailure() - return nil - } - - let searchNSLocation = NSRange(NSTextRange(location: location), provider: textContentManager).location - let fragmentLocation = NSRange( - NSTextRange(location: rangeInElement.location), - provider: textContentManager - ).location - return textLineFragments.first { lineFragment in - let absoluteLineRange = NSRange( - location: lineFragment.characterRange.location + fragmentLocation, - length: lineFragment.characterRange.length - ) - return absoluteLineRange.contains(searchNSLocation) - } - } -}