Editor (@NotNull Project project, @Nullable Editor editor, VirtualFile file) { Editor finalEditor = editor == null || !file.equals(editor.getVirtualFile()) ? getEditor(project, file) : editor; if (finalEditor == null) return null; return finalEditor; }