Skip to content

Commit af2d71b

Browse files
[chore:] Update CodeEditTextView to 0.9.1 (#307)
Updates CodeEditTextView to `0.9.1` from `0.8.3`. Includes changes from [`0.9.0`](https://github.com/CodeEditApp/CodeEditTextView/releases/tag/0.9.0) and [`0.9.1`](https://github.com/CodeEditApp/CodeEditTextView/releases/tag/0.9.1)
1 parent 1beac47 commit af2d71b

File tree

5 files changed

+5
-20
lines changed

5 files changed

+5
-20
lines changed

Example/CodeEditSourceEditorExample/CodeEditSourceEditorExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
// A fast, efficient, text view for code.
1818
.package(
1919
url: "https://github.com/CodeEditApp/CodeEditTextView.git",
20-
from: "0.8.2"
20+
from: "0.9.1"
2121
),
2222
// tree-sitter languages
2323
.package(

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,11 @@ extension TextView: TextInterface {
3939
/// - Parameter mutation: The mutation to apply.
4040
public func applyMutation(_ mutation: TextMutation) {
4141
guard !mutation.isEmpty else { return }
42-
43-
delegate?.textView(self, willReplaceContentsIn: mutation.range, with: mutation.string)
44-
45-
layoutManager.beginTransaction()
46-
textStorage.beginEditing()
47-
48-
layoutManager.willReplaceCharactersInRange(range: mutation.range, with: mutation.string)
4942
_undoManager?.registerMutation(mutation)
5043
textStorage.replaceCharacters(in: mutation.range, with: mutation.string)
5144
selectionManager.didReplaceCharacters(
5245
in: mutation.range,
5346
replacementLength: (mutation.string as NSString).length
5447
)
55-
56-
textStorage.endEditing()
57-
layoutManager.endTransaction()
58-
59-
delegate?.textView(self, didReplaceContentsIn: mutation.range, with: mutation.string)
6048
}
6149
}

Sources/CodeEditSourceEditor/Highlighting/Highlighter.swift

Lines changed: 0 additions & 3 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,8 +280,6 @@ extension Highlighter: StyledRangeContainerDelegate {
281280
}
282281

283282
textView.textStorage.endEditing()
284-
textView.layoutManager.endTransaction()
285-
textView.layoutManager.invalidateLayoutForRange(range)
286283
}
287284
}
288285

0 commit comments

Comments
 (0)