-
If I do a SelectRange, and then a Paste, RichTextKit only does an insertion not a replacement. Is there some other way to achieve what I want? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 1 reply
-
This must be an oversight from my side. Pasting should behave as you describe. |
Beta Was this translation helpful? Give feedback.
-
Im having problems with the following line: context.handle(.replaceText(in: myRange, with: attrText)) It seems that attrText is not replacing myRange, but is inserted at .location of myRange. Can you confirm this (and if so correct it) ? Thanks |
Beta Was this translation helpful? Give feedback.
-
I have debugged into and it seems that the range argument is not passed correctly. I pass a non-null range, but in RichTextCoordinator+Actions.swift I am seeing NSRange(0,0). That would explain the behaviour. However, I was not able to find where the range gets lost... |
Beta Was this translation helpful? Give feedback.
-
My update is definitely running on @mainactor... I do see immediate updates, but they replace the 0,0 range all the time. |
Beta Was this translation helpful? Give feedback.
-
I am very sorry. My fault. I passed an old value of my range. Everything is OK !!! So, sorry ! Apologies ! |
Beta Was this translation helpful? Give feedback.
-
Haha ok, so can we close this? |
Beta Was this translation helpful? Give feedback.
I am very sorry. My fault. I passed an old value of my range. Everything is OK !!!
So, sorry ! Apologies !