Comment by secondcoming
Comment by secondcoming 3 days ago
Is it even possible to write any text editor without some form of rope data structure?
Comment by secondcoming 3 days ago
Is it even possible to write any text editor without some form of rope data structure?
VSCode uses a piece table (https://code.visualstudio.com/blogs/2018/03/23/text-buffer-r...).
MS Word used piece table, which led to the "fast save" feature - which saved only the newer pieces.
Most certainly: gap buffers, piece tables, and line arrays are also popular choices.
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