A paper that covers some of the data structures used in editors is:
https://www.cs.unm.edu/~crowley/papers/sds.pdf
The gap buffer, in particular, is a great example of a simple yet powerful idea that is perfectly suited to the problem domain.
https://www.cs.unm.edu/~crowley/papers/sds.pdf
The gap buffer, in particular, is a great example of a simple yet powerful idea that is perfectly suited to the problem domain.