Skip to content

Commit 3581f1f

Browse files
committed
Add force to updateSelectionViews
1 parent ce0bfad commit 3581f1f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/CodeEditTextView/TextSelectionManager/TextSelectionManager+Update.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ extension TextSelectionManager {
3939
}
4040
}
4141

42-
func notifyAfterEdit() {
43-
updateSelectionViews()
42+
public func notifyAfterEdit(force: Bool = false) {
43+
updateSelectionViews(force: force)
4444
NotificationCenter.default.post(Notification(name: Self.selectionChangedNotification, object: self))
4545
}
4646
}

Sources/CodeEditTextView/TextSelectionManager/TextSelectionManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public class TextSelectionManager: NSObject {
138138

139139
/// Update all selection cursors. Placing them in the correct position for each text selection and reseting the
140140
/// blink timer.
141-
func updateSelectionViews() {
141+
func updateSelectionViews(force: Bool = false) {
142142
guard textView?.isFirstResponder ?? false else { return }
143143
var didUpdate: Bool = false
144144

@@ -197,7 +197,7 @@ public class TextSelectionManager: NSObject {
197197
}
198198
}
199199

200-
if didUpdate {
200+
if didUpdate || force {
201201
delegate?.setNeedsDisplay()
202202
cursorTimer.resetTimer()
203203
resetSystemCursorTimers()

0 commit comments

Comments
 (0)