void (@NotNull VirtualFile file, Editor originalEditor) { Document document = FileDocumentManager.getInstance().getDocument(file, myProject); int offset = 0; if (document != null && myLineNumber >= 0 && myLineNumber < document.getLineCount()) { offset = document.getLineStartOffset(myLineNumber); } OpenFileDescriptor descriptor = new OpenFileDescriptor(myProject, file, offset); Editor editor = FileEditorManager.getInstance(myProject).openTextEditor(descriptor, true); if (myAction != null && editor != null) { if (editor instanceof EditorEx) { ((EditorEx)editor).setCaretEnabled(false); try { myAction.onLinkFollowed(myProject, file, editor, originalEditor); } finally { ((EditorEx)editor).setCaretEnabled(true); } } else { myAction.onLinkFollowed(myProject, file, editor, originalEditor); } } }