Take a look at http://www.smalltalkhub.com/#!/~sig/TxText
there's already a working (since tests are green ;)
implementation of new text model.
And, as you said, you don't have to deal with hardcoded stuff.
The text model provides a 'position' API,
which can be used to navigate text directly:
�- moveLeft, moveRight, lineUp, lineDown etc
There's also a 'selection' model, which allows you to 'cut' , or
'replace' portions
of text at given position.
So, the text model designed by having text editor in mind.
I am working on making attributes work for it (bold/italic etc)..
and then renderer, layouting and editor(s).
Well, actually editor will be most simplest piece of puzzle after i
finish all the bottom layers :)