File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Sources/CodeEditTextView/Utils Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,11 @@ public class CEUndoManager: UndoManager {
8080 NotificationCenter . default. post ( name: . NSUndoManagerWillUndoChange, object: self )
8181 textView. textStorage. beginEditing ( )
8282 for mutation in item. mutations. reversed ( ) {
83- textView. replaceCharacters ( in: mutation. inverse. range, with: mutation. inverse. string)
83+ textView. replaceCharacters (
84+ in: mutation. inverse. range,
85+ with: mutation. inverse. string,
86+ skipUpdateSelection: true
87+ )
8488 }
8589 textView. textStorage. endEditing ( )
8690
@@ -108,7 +112,11 @@ public class CEUndoManager: UndoManager {
108112 textView. selectionManager. removeCursors ( )
109113 textView. textStorage. beginEditing ( )
110114 for mutation in item. mutations {
111- textView. replaceCharacters ( in: mutation. mutation. range, with: mutation. mutation. string)
115+ textView. replaceCharacters (
116+ in: mutation. mutation. range,
117+ with: mutation. mutation. string,
118+ skipUpdateSelection: true
119+ )
112120 }
113121 textView. textStorage. endEditing ( )
114122
You can’t perform that action at this time.
0 commit comments