For a text buffer with today's computers, you can really just use one continuous buffer (like a vector) because the processors are fast enough to make the insert time (an operation o(n)with this naive approach) still a viable option.
In the past, when computers were a thousand times slower, a simple simple approach was to save the text in the buffer, but with a βholeβ corresponding to the cursor position, to insert an operation o(1)and move characters from one (basically, moving the cursor a o(k), where kis the number of missing characters).
, , , , , . -, ... , ( ) .