Skip to content

Commit 013566b

Browse files
Sync System Cursor Animation (#56)
1 parent 2b0c29e commit 013566b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Sources/CodeEditTextView/TextSelectionManager/TextSelectionManager.swift

+10
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,16 @@ public class TextSelectionManager: NSObject {
188188
if didUpdate {
189189
delegate?.setNeedsDisplay()
190190
cursorTimer.resetTimer()
191+
resetSystemCursorTimers()
192+
}
193+
}
194+
195+
private func resetSystemCursorTimers() {
196+
guard #available(macOS 14, *) else { return }
197+
for cursorView in textSelections.compactMap({ $0.view as? NSTextInsertionIndicator }) {
198+
let frame = cursorView.frame
199+
cursorView.frame = .zero
200+
cursorView.frame = frame
191201
}
192202
}
193203

0 commit comments

Comments
 (0)