Skip to content
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

Fixed possible range mutation of the same attribute #239

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

arielpollack
Copy link

UITextView can split an NSAttributedString and set new font attribute if some substring has a different language which needs another font (for example when the mention include both English and Korean, the Korean substring will have another font attribute then the default one set to that UITextView).
After the "split", each substring still had the same pointer to the same HKWMentionsAttribute, which repeatedly changed its range to the latest, and then made the buffer include the same HKWMentionsAttribute pointer multiple times and prevented access to all mention attributes.

Here I just created a new attribute and set the range to it, so at least we can iterate all ranges and decide if we want to merge or not, depending on the use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant