Home▸Algorithms & AI▸Piece Table Diagram: Editing Text Without Moving It, Beside a Gap Buffer and a Flat Array

Piece Table Diagram: Editing Text Without Moving It, Beside a Gap Buffer and a Flat Array

Piece Table Diagram: Editing Text Without Moving It, Beside a Gap Buffer and a Flat Array

Algorithms & AI2DModerate60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
Piece Table Diagram: Editing Text Without Moving It, Beside a Gap Buffer and a Flat Array ↗ Open standalone

Type and delete text in a simulated editor and watch its piece table track original and add buffers with a linked list of piece descriptors, instead of copying the whole document on every keystroke.

⚙ Under the hood

Piece Table Diagram: Editing Text Without Moving It, Beside a Gap Buffer and a Flat Array

piece tabletext editorsdata structureslinked listundo redotext bufferseditor internalsalgorithmsgap buffer

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)