Skip to content

Always Show Highlights After Applying #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Always Show Highlights After Application
  • Loading branch information
thecoolwinter committed Jan 8, 2025
commit 979b35a4b06f640f34a7c43af673db1f54de6bf4
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