Skip to content

Commit 5c2949f

Browse files
committed
Remove extra layoutManager calls
1 parent 1beac47 commit 5c2949f

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

Sources/CodeEditSourceEditor/Extensions/TextView+/TextView+TextFormation.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,8 @@ extension TextView: TextInterface {
4242

4343
delegate?.textView(self, willReplaceContentsIn: mutation.range, with: mutation.string)
4444

45-
layoutManager.beginTransaction()
4645
textStorage.beginEditing()
4746

48-
layoutManager.willReplaceCharactersInRange(range: mutation.range, with: mutation.string)
4947
_undoManager?.registerMutation(mutation)
5048
textStorage.replaceCharacters(in: mutation.range, with: mutation.string)
5149
selectionManager.didReplaceCharacters(
@@ -54,7 +52,6 @@ extension TextView: TextInterface {
5452
)
5553

5654
textStorage.endEditing()
57-
layoutManager.endTransaction()
5855

5956
delegate?.textView(self, didReplaceContentsIn: mutation.range, with: mutation.string)
6057
}

Sources/CodeEditSourceEditor/Highlighting/Highlighter.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ extension Highlighter: NSTextStorageDelegate {
266266
extension Highlighter: StyledRangeContainerDelegate {
267267
func styleContainerDidUpdate(in range: NSRange) {
268268
guard let textView, let attributeProvider else { return }
269-
textView.layoutManager.beginTransaction()
270269
textView.textStorage.beginEditing()
271270

272271
let storage = textView.textStorage
@@ -281,7 +280,6 @@ extension Highlighter: StyledRangeContainerDelegate {
281280
}
282281

283282
textView.textStorage.endEditing()
284-
textView.layoutManager.endTransaction()
285283
textView.layoutManager.invalidateLayoutForRange(range)
286284
}
287285
}

0 commit comments

Comments
 (0)