Skip to content
Open
Changes from all commits
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
8 changes: 8 additions & 0 deletions ios/attributesManager/AttributesManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ - (void)handleDirtyRangesStyling {
presentStyles[@([[style class] getType])] = [style all:dirtyRange];
}

// Wrap the reset+reapply in beginEditing/endEditing so TextKit processes
// all attribute changes atomically. Without this, removing
// NSAttachmentAttributeName triggers a layout pass where \uFFFC has zero
// width, causing the caret to render inside inline images.
[_input->textView.textStorage beginEditing];

// now reset the attributes to default ones
[_input->textView.textStorage setAttributes:_input->defaultTypingAttributes
range:dirtyRange];
Expand Down Expand Up @@ -110,6 +116,8 @@ - (void)handleDirtyRangesStyling {
[style applyStyling:occurenceRange];
}
}

[_input->textView.textStorage endEditing];
}
// do the typing attributes management, with no selection
[self manageTypingAttributesWithOnlySelection:NO];
Expand Down