-
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
Extract caret and selection to separate classes #526
Conversation
@DaveJarvis What's your feedback on this API? I'm also wondering where the default methods for the caret/selection API that was extracted into I don't have fancier methods like |
Regarding Caret.java:
In BoundedSelection.java:
The The
Lines 150 to 160 of BoundedSelectionImpl.java contain duplication that can be eliminated with a variable assignment. |
Thanks for the feedback! Caret
I agree that documentation should be added to explain the purpose of the code at both the class/interface and method levels. At the same time, I'm not sure about the extent that you're describing when it comes to documenting pre-conditions, post-conditions, and the meaning of parameter values. Tomas believes in self-documenting code; I agree with it in principle, but still would like some documentation to explain what's going on. I think that's accomplished when the purpose is documented along with clear parameter names.
Aye, I'd like to put that in the interface level since this would be the best place to document that. Originally,
I'm iffy on this. I added that in case one needed to use it as a trigger for something else. However, I can't think of any use cases off the top of my head, and I suppose they could just use either the caret's Selection
The right way would be
That's intentional. It allows one to store a list of
True, but that's why |
Not sure I understand you. Could you rewrite the method in your way to explain? |
|
in cef005b, I made a typo: |
@DaveJarvis If you have additional feedback, please share. Otherwise, I'll merge this sometime tomorrow. |
One issue I just realized: |
I think for now, I'll leave that out. Only those who use custom objects in an area might use it, and of those that create such an area, most will probably not use it. |
On second thought, one could write |
- Necessary when using custom objects and "selectedText" is not enough.
Address #429.