void (@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file) { LookupManager.getInstance(project).hideActiveLookup(); int caretOffset = editor.getCaretModel().getOffset(); int caretLine = editor.getCaretModel().getLogicalPosition().line; int[] offsets = MethodUpDownUtil.getNavigationOffsets(file, caretOffset); for (int offset : offsets) { if (offset > caretOffset) { int line = editor.offsetToLogicalPosition(offset).line; if (line > caretLine) { editor.getCaretModel().removeSecondaryCarets(); editor.getCaretModel().moveToOffset(offset); editor.getSelectionModel().removeSelection(); editor.getScrollingModel().scrollToCaret(ScrollType.CENTER_DOWN); IdeDocumentHistory.getInstance(project).includeCurrentCommandAsNavigation(); break; } } } }