dispose preview after balloon is closed so no green rec is visible
authorAnna.Kozlova <anna.kozlova@jetbrains.com>
Fri, 11 Nov 2016 18:27:27 +0000 (19:27 +0100)
committerAnna.Kozlova <anna.kozlova@jetbrains.com>
Fri, 11 Nov 2016 19:54:11 +0000 (20:54 +0100)
platform/lang-impl/src/com/intellij/refactoring/changeSignature/inplace/InplaceChangeSignature.java

index 68cd6ef00cc535ed99bcfb4fcbe1e3db244464c8..e8cf7d9b98d7c0e64a1cf173ec80a911430996cf 100644 (file)
@@ -37,6 +37,7 @@ import com.intellij.openapi.ui.Messages;
 import com.intellij.openapi.ui.popup.Balloon;
 import com.intellij.openapi.ui.popup.BalloonBuilder;
 import com.intellij.openapi.ui.popup.JBPopupFactory;
 import com.intellij.openapi.ui.popup.Balloon;
 import com.intellij.openapi.ui.popup.BalloonBuilder;
 import com.intellij.openapi.ui.popup.JBPopupFactory;
+import com.intellij.openapi.util.Disposer;
 import com.intellij.openapi.util.Key;
 import com.intellij.openapi.util.TextRange;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.openapi.util.Key;
 import com.intellij.openapi.util.TextRange;
 import com.intellij.openapi.vfs.VirtualFile;
@@ -225,6 +226,10 @@ public class InplaceChangeSignature implements DocumentListener {
         return new RelativePoint(myEditor.getContentComponent(), point);
       }
     }, Balloon.Position.above);
         return new RelativePoint(myEditor.getContentComponent(), point);
       }
     }, Balloon.Position.above);
+    Disposer.register(myBalloon, () -> {
+      EditorFactory.getInstance().releaseEditor(myPreview);
+      myPreview = null;
+    });
   }
 
   public void detach() {
   }
 
   public void detach() {
@@ -238,8 +243,6 @@ public class InplaceChangeSignature implements DocumentListener {
     myDetector = null;
     FinishMarkAction.finish(myProject, myEditor, myMarkAction);
     myEditor.putUserData(INPLACE_CHANGE_SIGNATURE, null);
     myDetector = null;
     FinishMarkAction.finish(myProject, myEditor, myMarkAction);
     myEditor.putUserData(INPLACE_CHANGE_SIGNATURE, null);
-    EditorFactory.getInstance().releaseEditor(myPreview);
-    myPreview = null;
   }
 
   public static void temporallyRevertChanges(final TextRange signatureRange,
   }
 
   public static void temporallyRevertChanges(final TextRange signatureRange,