From a175c4094f9735f5524fc6f19b8bca6243ebcc3d Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 28 Jan 2019 17:13:17 +0300 Subject: [PATCH] IDEA-205976: update a focused file before rebuilding a structure view --- .../src/com/intellij/ide/impl/StructureViewWrapperImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java b/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java index bb00c8f4e333..9b93c4773560 100644 --- a/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/impl/StructureViewWrapperImpl.java @@ -122,7 +122,10 @@ public class StructureViewWrapperImpl implements StructureViewWrapper, Disposabl @Override public void hierarchyChanged(HierarchyEvent e) { if (BitUtil.isSet(e.getChangeFlags(), HierarchyEvent.DISPLAYABILITY_CHANGED)) { - LOG.debug("displayability changed"); + boolean visible = myToolWindow.isVisible(); + LOG.debug("displayability changed: " + visible); + if (!visible) return; // do nothing on hide + loggedRun("update file", StructureViewWrapperImpl.this::checkUpdate); scheduleRebuild(); } }