The Piece Table - the Unsung Hero of Your Text Editor
Summary
The article explains the piece table data structure used in text editors, showing how original and add buffers, along with piece descriptors, enable efficient editing, undo, and saving. It contrasts this with the naive array of strings approach and shows how insertions are handled without shifting large blocks of memory. It also touches on historical usage in editors like VS Code and Word.