boolean (@NotNull Project project, ModNavigate nav) { VirtualFile file = actualize(nav.file()); if (file == null) return false; int selectionStart = nav.selectionStart(); int selectionEnd = nav.selectionEnd(); int caret = nav.caret(); Editor editor = getEditor(project, file); if (editor == null) return false; if (caret != -1) { editor.getCaretModel().moveToOffset(caret); } if (selectionStart != -1 && selectionEnd != -1) { editor.getSelectionModel().setSelection(selectionStart, selectionEnd); } return true; }