The Data Structures Behind Text Editors: Gap Buffers, Piece Tables, Ropes, and CRDTs
Open a text editor, type a character, and it appears on screen. That single keystroke triggers a surprisingly deep question: how does the editor represent your document in memory so that insertions, deletions, and cursor movements all feel instant, even on a file with millions of lines...