Hello. Can you add me as project contributor. I try to upload version with detailed comment from my first mail but can't.
2012/11/18 Camillo Bruni <[email protected]> > 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. > If such behaviour will be at view simple Cursor>>moveUp/moveDown will never work right from user perspective. So why you need cursor at text model which will never reflect state of visual cursor at screen? To me text model should completelly represent what user see at text view. Otherwise why you call it model? Otherwise it is just raw data like Text in current TextMorph. > 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). > I think It can be solve easilly if text model will reflect visual lines of text. For example, imagine my simple idea where TextView is just list of SpanMorph's. When user click on text concrete span morph will handle it because TextView is just morph with submorphs (no special behaviour). So target SpanMorph should just compute span position under mouse and change text model cursor position appropriatelly. Then cursor will announce #changed event and CursorMorph will reflect this automatically. 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. > Just remember two kinds of such line width restrictions: width in pixels and width in characters. First is usual text wrapping behaviour when line width restricted by view width. Last is when editor wrap lines which contains >100 characters for example.
