void (@NotNull FileEditor editor) { if (myProject.isDisposed() || !CoverageView.this.isShowing()) return; if (myStateBean.myAutoScrollFromSource) { VirtualFile file = editor.getFile(); if (file != null && canSelect(file)) { PsiElement e = null; if (editor instanceof TextEditor) { int offset = ((TextEditor)editor).getEditor().getCaretModel().getOffset(); PsiDocumentManager.getInstance(myProject).commitAllDocuments(); PsiFile psiFile = PsiManager.getInstance(myProject).findFile(file); if (psiFile != null) { e = psiFile.findElementAt(offset); } } select(e != null ? e : file); } } }