["Piece tree"](https://cdacamar.github.io/data%20structures/algorithms/benchmarking/text%20editors/c++/editor-data-structures/) is a "**multiple buffer piece table with red-black tree, optimized for line model**" [proposed by the team behind vscode](https://code.visualstudio.com/blogs/2018/03/23/text-buffer-reimplementation) i.e. an efficient data structure **for text editors**. - [implementation in typescript](https://github.com/microsoft/vscode-textbuffer) - [immutable version in C++](https://github.com/cdacamar/fredbuf/tree/main) - [1998 paper describing the data structure](https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.48.1265&rep=rep1&type=pdf)