Skip to content

Commit

Permalink
Set highlighted range
Browse files Browse the repository at this point in the history
  • Loading branch information
DominikBucher12 committed Jan 24, 2024
1 parent 2533a19 commit 076651f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Sources/RichTextKit/Actions/RichTextAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/RichTextKit/Context/RichTextContext+Actions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/RichTextKit/Context/RichTextContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 076651f

Please sign in to comment.