mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
[coverage] EA-926372 Move auto selection in coverage tree to BGT
GitOrigin-RevId: 1cac69c23f26344927678b17557e88bf43a2a070
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cfda9bd3f1
commit
f3221958e3
@@ -592,13 +592,14 @@ public class CoverageView extends BorderLayoutPanel implements DataProvider, Dis
|
||||
@Override
|
||||
protected void selectElementFromEditor(@NotNull FileEditor editor) {
|
||||
if (myProject.isDisposed() || !CoverageView.this.isShowing()) return;
|
||||
if (myStateBean.myAutoScrollFromSource) {
|
||||
if (!myStateBean.myAutoScrollFromSource) return;
|
||||
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
|
||||
ReadAction.nonBlocking(() -> {
|
||||
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);
|
||||
@@ -606,7 +607,7 @@ public class CoverageView extends BorderLayoutPanel implements DataProvider, Dis
|
||||
}
|
||||
select(e != null ? e : file);
|
||||
}
|
||||
}
|
||||
}).submit(AppExecutorUtil.getAppExecutorService());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user