How to specific selection start position and end position

for example, there is following code:

1  line
2  line

I wanna specific start position as (1,1)("1" in "1 line") and specific end position as(2, 7) ("e" in "2 line"),
my question is How should I do that?

2 comments
Comment actions Permalink

I find following in JsonPlugin.xml

 
<extendWordSelectionHandler implementation="com.intellij.json.editor.selection.JsonStringLiteralSelectionHandler"/>
<basicWordSelectionFilter implementation="com.intellij.json.editor.selection.JsonBasicWordSelectionFilter"/>
  
but I hope you can tell way to implement selection in Action
0
Comment actions Permalink

Editor.getSelectionModel().setSelection()

To convert a line/column number to an offset, use Editor.logicalPositionToOffset()

0

Please sign in to leave a comment.