Re:Text Showdown: Gap Buffers vs. Ropes
by teo_zero on Tuesday October 10, 2023 @04:19AM
(#37829681)
The trick is to decouple the concept of 'position' in the text, that is independent of the gap, from 'pointer' into the buffer. If you keep track of line beginnings as positions, you can immediately get the pointers:
[ Parent
| on HN ]