News for hackers. Stuff that matters.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by secondcoming on Wednesday January 15, 2025 @01:56PM (#42715352)
Is it even possible to write any text editor without some form of rope data structure?
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by caconym_ on Wednesday January 15, 2025 @02:17PM (#42715642)
Gap buffers are the other classic option, and there are others too, e.g. piece tables.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by cschmidt on Wednesday January 15, 2025 @02:29PM (#42715775)
Here's a paper reviewing the various choices, that is often mentioned in discussions around data structures for text editors:

https://www.cs.unm.edu/~crowley/papers/sds.pdf

Re:Ropey – A UTF8 text rope for manipulating and editing lar... by marssaxman on Wednesday January 15, 2025 @02:30PM (#42715797)
Most certainly: gap buffers, piece tables, and line arrays are also popular choices.
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by ben-schaaf on Wednesday January 15, 2025 @09:08PM (#42720129)
Re:Ropey – A UTF8 text rope for manipulating and editing lar... by canucker2016 on Thursday January 16, 2025 @02:56AM (#42722593)
MS Word used piece table, which led to the "fast save" feature - which saved only the newer pieces.