-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose API for page up/down #376
Conversation
after pressing the Up arrow, the caret moves here:
but
instead of
|
Then, shouldn't that be moved to |
It can't be in model since it is view specific. It really is pixel offset, not a logical position in text. |
Aye, just realized that.... |
I want to put the code in |
That I cannot answer 😃 I would say, just put it into |
😆 If I put it into |
Sounds good. I think it was my attempt to distinguish what are the core methods (these are those that are abstract in those interfaces) and what are derived methods (those with default implementation in the interfaces). StyledTextArea(Model) can then focus on implementing only the core methods, inheriting the implementations of the derived methods. The goal was to make StyledTextArea code clearer, but I'm not sure that it really helped. |
On second thought, looks like I'll need to clean it up first before exposing the page up/down API. Additionally, StyledTextAreaBehavior does not need access to the model since it can access those things through the view. The only reason to do so is to save some time by avoiding a method wrapper (view calls the same method in model). |
Sigh... removing the interfaces then screws up the STAModel's tests. Screw this... I'm going to just put the code in the area as opposed to the interface. Fixing the above test issue, along with cleaning up the interfaces themselves, should be something we do in a different PR. |
Ok, now it works. |
Yay! 👍 |
I don't know whether I should open a new issue regarding this, and I don't know what I would start with in setting up a new PR for this, but what should we do to clean up the implementations? There is value in having the model implement those interfaces because we can use it still when creating tests (as opposed to having to do that via the view). At the same time, some methods can't go into the interfaces due them being view-related. However, removing those interfaces from the model would then lead to code duplication. If we break up the interfaces into more ones, then I assume that it will get more confusing/scattered. |
When in doubt, do nothing 😃 |
Sounds good to me. Besides, it won't cause any extra work for the custom object PR (#314) |
Is
StyledTextAreaBehavior#TargetCaretOffset
even needed after this (line 220)?