News for hackers. Stuff that matters.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by favorited on Wednesday January 15, 2025 @03:13PM (#42716292)
If you'd like an example of how this can be done, Swift's AttributedString type is exactly that. It manages the association of runs of attributes (font, kerning, color, etc.) with Unicode text, and its backing storage uses a rope type provided by the swift-collections package. (The rope module itself isn't stabilized yet, so it's really only used for AttributedString at this point, AFAIK.)

https://github.com/swiftlang/swift-foundation/tree/main/Sour...

https://github.com/apple/swift-collections/tree/main/Sources...

There are no comments on this comment yet.