On 25 November 2012 15:18, Denis Kudriashov <[email protected]> wrote: > Hello > > 2012/11/22 Igor Stasenko <[email protected]> >> >> On 22 November 2012 12:32, Igor Stasenko <[email protected]> wrote: >> > On 22 November 2012 11:47, Stephan Eggermont <[email protected]> wrote: >> >> Hi Igor, >> >> >> >> The TxText model to me seems to mix two concerns. >> >> The storage of the text and manipulating it? Both cursor positioning >> >> and selection manipulation are view dependent, and there might >> >> be more than one. >> >> >> > >> > No. Please read my other replies to topic. >> > >> > - you have text model >> > - you have positions (in text) >> > - you have selection which is two positions >> > - you define operations, like insert, cut, replace which involving >> > text and positions in them. >> > - you cannot manipulate(edit) text without using positions >> > >> > where you see view dependent stuff? >> > It is completely orthogonal. >> > >> >> perhaps you talking about 'selection' which is part of TxModel state? >> then i agree that we may need to separate concerns here: >> - text storage >> - text selection. >> >> but you can do it even right now: >> >> | text selection | >> text := TxModel new. >> selection := TxSelection on: text. >> >> selection replaceWith: 'ABC'. >> selection all. >> selection start moveRight. >> selection end moveLeft. >> selection replaceWith: '---'. >> text asString >> 'A---C' >> >> i think we should remove 'selection' from TxModel class. >> And instead provide a protocol for getting a new one, i.e.: >> >> selection := text newSelection. > > > Agree with this
Thanks, Denis and Stephen. You already made valuable contribution to the project by pointing on some design issues. I should turn back my eyes to it, once i will finish with NativeBoost update. -- Best regards, Igor Stasenko.
