Y
Hacker News
new
|
ask
|
show
|
jobs
by
secondcoming
516 days ago
Is it even possible to write any text editor without some form of rope data structure?
4 comments
cschmidt
516 days ago
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
link
ben-schaaf
516 days ago
VSCode uses a piece table (
https://code.visualstudio.com/blogs/2018/03/23/text-buffer-r...
).
link
canucker2016
516 days ago
MS Word used piece table, which led to the "fast save" feature - which saved only the newer pieces.
link
caconym_
516 days ago
Gap buffers are the other classic option, and there are others too, e.g. piece tables.
link
marssaxman
516 days ago
Most certainly: gap buffers, piece tables, and line arrays are also popular choices.
link
https://www.cs.unm.edu/~crowley/papers/sds.pdf