We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13a455e commit 49aee7fCopy full SHA for 49aee7f
Sources/CodeEditTextView/TextSelectionManager/TextSelectionManager+Update.swift
@@ -6,15 +6,13 @@
6
//
7
8
import Foundation
9
-import AppKit
10
11
extension TextSelectionManager {
12
public func didReplaceCharacters(in range: NSRange, replacementLength: Int) {
13
let delta = replacementLength == 0 ? -range.length : replacementLength
14
for textSelection in self.textSelections {
15
if textSelection.range.location > range.max {
16
textSelection.range.location = max(0, textSelection.range.location + delta)
17
-
18
textSelection.range.length = 0
19
} else if textSelection.range.intersection(range) != nil
20
|| textSelection.range == range
0 commit comments