Interesting that text editors use Gap buffers. Its like a temporary register (block of memory) used to append text characters while the user edits (adds) to the file and then it gets saved, the remaining empty part is truncated. Clever data structure.
He explained it so nicely, the approach, the problem and then a new intuition, again a limitation, then a proper intuition.
Vi uses linked linked like data structure for editing, very interesting.