in src/main/java/idea/plugin/psiviewer/view/PsiViewerPanel.java [226:247]
private void setSelectedElement(PsiElement element, String reason)
{
if (inSetSelectedElement)
return;
debug("selection changed to " + element + " due to " + reason);
_selectedElement = element;
updatePropertySheet(() -> {
if (reason != TREE_SELECTION_CHANGED)
changeTreeSelection();
applyHighlighting();
if (reason != CARET_MOVED && element != null) {
try {
inSetSelectedElement = true;
moveEditorCaret();
} finally {
inSetSelectedElement = false;
}
}
});
}