Hello.
Can you add me as project contributor. I try to upload version with detailed comment from my first mail but can't.
I don't think the basic model should know about the visual lines. We discussed
that for a while, but in the end that's purely a view on the basic model.
For instance if you want to get the insertion point when clicking on some
text view you have to take so many model-unrelated things into account
(global transformation, font sizes).
3) What about auto wrap behaviour?
If you have auto wrap option at text editors you have line width restriction. And you should spit real lines of text to visual lines which satisfed this restriction. And text mode should know about such restriction because any text insertion can require new visual lines creation.
I think insertion single line text at span position should be executed by special "restriction object". It should return new characters of span which satisfied that restriction. And it should return new span object (or just remains characters) which will present new visual lines. Then this "remains characters" should be inserted to next span at 0 position.
When wrap behavior not needed "restriction object" just inserts new text into current characters at given position and returns result.