Skip to content

Commit 8db24b1

Browse files
Update TextLayoutManager+Layout.swift
Co-authored-by: Tom Ludwig <tommludwig@icloud.com>
1 parent 047d827 commit 8db24b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/CodeEditTextView/TextLayoutManager/TextLayoutManager+Layout.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ extension TextLayoutManager {
6363
/// pass is already ongoing, internal data structures will be broken. In debug builds, this is checked with a simple
6464
/// boolean and assertion.
6565
///
66-
/// To help ensure this property, all view modifications are done in a `CATransaction`. This ensures that only after
67-
/// we're done inserting and removing line fragment views, does macOS call `layout` on any related views. Otherwise,
68-
/// we may cause a layout pass when a line fragment view is inserted and cause a reentrance in this method.
66+
/// To help ensure this property, all view modifications are performed within a `CATransaction`. This guarantees that macOS calls
67+
/// `layout` on any related views only after we’ve finished inserting and removing line fragment views. Otherwise,
68+
/// inserting a line fragment view could trigger a layout pass prematurely and cause this method to re-enter.
6969
///
7070
/// - Warning: This is probably not what you're looking for. If you need to invalidate layout, or update lines, this
7171
/// is not the way to do so. This should only be called when macOS performs layout.

0 commit comments

Comments
 (0)