If efficiency is not a concern, then you can easily use something like
this (just a quick prototype, didn't verify if it's correct or not):

        [...]

Thanks for the free code :)
I think that will be the way to go in my case, since most input will be
ascii and moving the cursor will be quite rare


If I was expecting a decent amount of non-ascii input, I would use the
bitvector approach described by Thomas Oltmann. 1bit per byte overhead
should be fine for most use-cases.

I think it is very good too, the only problem is the overhead of having
to preprocess everything


Thank you a lot for helping!
        ~ Arthur Bacci

Reply via email to