Skip to content

Commit

Permalink
Always Show Highlights After Applying (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecoolwinter authored Jan 8, 2025
1 parent 63bae5a commit 2810b76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/CodeEditSourceEditor/Highlighting/Highlighter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ extension Highlighter: NSTextStorageDelegate {
extension Highlighter: StyledRangeContainerDelegate {
func styleContainerDidUpdate(in range: NSRange) {
guard let textView, let attributeProvider else { return }
// textView.layoutManager.beginTransaction()
textView.layoutManager.beginTransaction()
textView.textStorage.beginEditing()

let storage = textView.textStorage
Expand All @@ -216,8 +216,8 @@ extension Highlighter: StyledRangeContainerDelegate {
}

textView.textStorage.endEditing()
// textView.layoutManager.endTransaction()
// textView.layoutManager.invalidateLayoutForRange(range)
textView.layoutManager.endTransaction()
textView.layoutManager.invalidateLayoutForRange(range)
}
}

Expand Down

0 comments on commit 2810b76

Please sign in to comment.