diff --git a/Sources/RichTextKit/Actions/RichTextAction.swift b/Sources/RichTextKit/Actions/RichTextAction.swift index f94756a0f..e616fd964 100644 --- a/Sources/RichTextKit/Actions/RichTextAction.swift +++ b/Sources/RichTextKit/Actions/RichTextAction.swift @@ -63,7 +63,7 @@ public enum RichTextAction: Identifiable, Equatable, RichTextLabelValue { case setStrokeColor(ColorRepresentable) // Highlighted renge - case highlightedRange(NSRange?) + case setHighlightedRange(NSRange?) // Change highlighting style case highlightingStyle(RichTextHighlightingStyle) @@ -106,7 +106,7 @@ public extension RichTextAction { case .setUnderlineColor: .richTextColorUnderline case .setStrikethroughColor: .richTextColorStrikethrough case .setStrokeColor: .richTextColorStroke - case .highlightedRange: .richTextAlignmentCenter + case .setHighlightedRange: .richTextAlignmentCenter case .highlightingStyle: .richTextAlignmentCenter case .pasteImage: .richTextDocuments case .pasteImages: .richTextDocuments @@ -154,7 +154,7 @@ public extension RichTextAction { case .setUnderlineColor: .underlineColor case .setStrikethroughColor: .strikethroughColor case .setStrokeColor: .strokeColor - case .highlightedRange: .highlightedRange + case .setHighlightedRange: .highlightedRange case .highlightingStyle: .highlightingStyle case .pasteImage: .pasteImage case .pasteImages: .pasteImages diff --git a/Sources/RichTextKit/Context/RichTextContext+Actions.swift b/Sources/RichTextKit/Context/RichTextContext+Actions.swift index e07d275cc..b1eb4986d 100644 --- a/Sources/RichTextKit/Context/RichTextContext+Actions.swift +++ b/Sources/RichTextKit/Context/RichTextContext+Actions.swift @@ -39,7 +39,7 @@ public extension RichTextContext { case .setUnderlineColor: return true case .setStrikethroughColor: return true case .setStrokeColor: return true - case .highlightedRange: return true + case .setHighlightedRange: return true case .highlightingStyle: return true case .pasteImage: return true case .pasteImages: return true diff --git a/Sources/RichTextKit/Context/RichTextContext.swift b/Sources/RichTextKit/Context/RichTextContext.swift index e77710f2e..d493486c0 100644 --- a/Sources/RichTextKit/Context/RichTextContext.swift +++ b/Sources/RichTextKit/Context/RichTextContext.swift @@ -159,7 +159,7 @@ public extension RichTextContext { /// Set ``highlightedRange`` to a new, optional range. func highlightRange(_ range: NSRange?) { - userActionPublisher.send(.highlightedRange(range)) + userActionPublisher.send(.setHighlightedRange(range)) highlightedRange = range } diff --git a/Sources/RichTextKit/Coordinator/RichTextCoordinator+Subscriptions.swift b/Sources/RichTextKit/Coordinator/RichTextCoordinator+Subscriptions.swift index d05d13f0c..c20794ebd 100644 --- a/Sources/RichTextKit/Coordinator/RichTextCoordinator+Subscriptions.swift +++ b/Sources/RichTextKit/Coordinator/RichTextCoordinator+Subscriptions.swift @@ -56,7 +56,7 @@ private extension RichTextCoordinator { setColor(color, for: .strikethrough) case .setStrokeColor(let color): setColor(color, for: .stroke) - case .highlightedRange(let range): + case .setHighlightedRange(let range): setHighlightedRange(to: range) case .highlightingStyle(let style): textView.highlightingStyle = style