macOS: extract attributed string helper
parent
36c91c3984
commit
9928f1b3c1
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue