-
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
Add variants of editing/navagiting methods that take relative index argument (paragraph index, column index) #331
Conversation
selectRange(anchor, pos); | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a little repetitive wrt. the method above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah... I'll fix that.
I chose |
Looks, good, just not sure if I want to use "Char" in the method names. I try to be consistent in using the term position when pointing to a place between characters, and character index when pointing to a character.
|
I agree with keeping it consistent. At the same time, I don't know if this distinction between position and character index is even stated in the javadoc or is as clear as the above picture. |
Well, since so many methods point to |
@@ -197,4 +265,39 @@ default void replace(IndexRange range, StyledDocument<PS, S> replacement) { | |||
*/ | |||
@Deprecated | |||
public void positionCaret(int pos); | |||
|
|||
/** | |||
* Returns the absolute position (e.g. the spot in-between characters) to the left of the given column in the given paragraph. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean "i.e." instead of "e.g." ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used "i.e." a lot until I saw you use "e.g." a lot. So, I thought they were the same and just used that whenever it related to you or this project. 😃 Having looked it up, I see the difference now.
…a its paragraph index and column index.
… argument (paragraph, column) rather than an absolute position (current approach) Every method that uses the `getAbsolutePosition` method includes a note about the potentially unexpected position returned if a column index argument spans outside of its corresponding paragraph's bounds.
👍 |
No description provided.