how to goto line with openapi

for instance; current cursor is in line 1, i invoke my action, cursor will goto line 100

1 comment
Comment actions Permalink

public void actionPerformed(final AnActionEvent event) { 
     Editor editor = event.getData(PlatformDataKeys.EDITOR);
     Document document = editor.getDocument();

     editor.getCaretModel().moveToOffset(document.getLineStartOffset(100), true);
}

0

Please sign in to leave a comment.