How to get lines with selected text

Hi,

I want to get lines selected in a java file.
I tried to do this with SelectionModel, but it's not very precise: it ignores collapsed lines - imports for example.
Do you know another approach that solves this issue

0

SelectionModel.getStartOffset() and SelectionModel.getEndOffset() are absolutely precise and do not ignore anything. You may want to read about the difference between LogicalPosition and VisualPosition in the javadoc of the Editor class.

0

请先登录再写评论。