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
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