Skip to content

Commit

Permalink
macOS guard
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Nov 20, 2023
1 parent 17e4c76 commit 1e4abb8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/TextStory/TextStorageEventRouter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ extension TextStorageEventRouter: TSYTextStorageDelegate {
}
}

#if os(macOS)
public func textStorage(_ textStorage: TSYTextStorage, doubleClickRangeForLocation location: UInt) -> NSRange {
if let provider = doubleClickWordRangeProvider {
return provider(Int(location))
}

return textStorage.internalStorage.doubleClick(at: Int(location))
}

Expand All @@ -68,4 +69,5 @@ extension TextStorageEventRouter: TSYTextStorageDelegate {

return UInt(textStorage.internalStorage.nextWord(from: Int(location), forward: forward))
}
#endif
}

0 comments on commit 1e4abb8

Please sign in to comment.