I need to determine if a given selection is in between a start line and an end line.
I have an ILineRange and a given offset within the viewport of eclipse. (I need to know, if the selection (from a remote party) was made within the current viewport of the local user. Unfortunately, I cannot get an ILineRange from the selection. I must rely on getOffset() and getLength()…
Anyone has an idea?
I think there is not a clean solution for this, as the offset (or the characters per line vary (new line lines or a big block of comment).
I need to determine if a given selection is in between a start line
Share
The conversion between positions and offsets can be done with IDocument’s API (methods around getLine*()). (I’m not sure I fully understood your question, but I do hope that this is helpful information.)