macOS: extract attributed string helper

This commit is contained in:
Peter Steinberger committed 2025-12-09 00:59:56 +01:00
1 parent 36c91c3984
commit 9928f1b3c1
2 files changed
+9 -8

No files matched your search

@@ -0,0 +1,9 @@
import Foundation
extension NSAttributedString {
func strippingForegroundColor() -> NSAttributedString {
let mutable = NSMutableAttributedString(attributedString: self)
mutable.removeAttribute(.foregroundColor, range: NSRange(location: 0, length: mutable.length))
return mutable
}
}
@@ -663,11 +663,3 @@ private final class TranscriptNSTextView: NSTextView {
super.keyDown(with: event)
}
}
private extension NSAttributedString {
func strippingForegroundColor() -> NSAttributedString {
let mutable = NSMutableAttributedString(attributedString: self)
mutable.removeAttribute(.foregroundColor, range: NSRange(location: 0, length: mutable.length))
return mutable
}
}