← 📝 Algorithms

📝 Piece Table: The Text Editor's Secret Edit Buffer

Doc Length:
Piece Count:
Drag — rotate · Scroll — zoom

📝 Piece Table: The Text Editor's Secret Edit Buffer

The simulation shows a live piece table backing a small text editor, visualizing the original buffer, the growing add buffer, and the linked list of piece descriptors updating as you type and delete characters.

🔬 What It Demonstrates

The simulation shows a live piece table backing a small text editor, visualizing the original buffer, the growing add buffer, and the linked list of piece descriptors updating as you type and delete characters.

🎮 How to Use

Type or delete text in the editor pane and watch the buffers and piece list panels update step by step, or use the playback controls to replay a sequence of edits and see exactly which pieces split or spliced at each step.

💡 Did You Know?

Because piece tables never overwrite existing buffer content, deleted text technically still sits untouched in memory even after it disappears from the document, simply no longer referenced by any active piece descriptor.