mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix PIEAE from structure view between PSI invalidation and delayed tree update
This commit is contained in:
+4
-2
@@ -125,9 +125,11 @@ public abstract class TextEditorBasedStructureViewModel implements StructureView
|
||||
@Override
|
||||
public Object getCurrentEditorElement() {
|
||||
if (myEditor == null) return null;
|
||||
final int offset = myEditor.getCaretModel().getOffset();
|
||||
final PsiFile file = getPsiFile();
|
||||
|
||||
PsiFile file = getPsiFile();
|
||||
if (!file.isValid()) return null;
|
||||
|
||||
int offset = myEditor.getCaretModel().getOffset();
|
||||
return findAcceptableElement(file.getViewProvider().findElementAt(offset, file.getLanguage()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user