how to goto line with openapi

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

0

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

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

0

请先登录再写评论。