Efficient Text Editing Buffer

Thanks, I never heard of a Gap buffer before, but that looks very close to what I am implementing, its just that I have the ‘gap’ as a separate item being the focus of the zipper.

There was also a link to the ‘rope’ structure apparently used by emacs: https://en.wikipedia.org/wiki/Rope_(data_structure)

And this: https://en.wikipedia.org/wiki/Piece_table, which brings up the issue of implementing undo efficiently, something I had not considered yet.

5 Likes