proper quick doc pop placement on second and subsequent invokations (when changing...
authorMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Thu, 22 Apr 2010 16:35:22 +0000 (20:35 +0400)
committerMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Thu, 22 Apr 2010 16:35:22 +0000 (20:35 +0400)
platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java

index 8e73be8d15a112454ecfd37fab010fc420f15263..c762b8c32109685e4a7eac810c0ebfbd380339de 100644 (file)
@@ -316,6 +316,12 @@ public class DocumentationManager {
 
       component.setHint(hint);
 
+      if (myEditor == null) { 
+        // subsequent invocation of javadoc popup from completion will have myEditor == null because of cancel invoked, 
+        // so reevaluate the editor for proper popup placement
+        Lookup lookup = LookupManager.getInstance(myProject).getActiveLookup();
+        myEditor = lookup != null ? lookup.getEditor() : null;
+      }
       fetchDocInfo(getDefaultCollector(element, originalElement), component);
 
       myDocInfoHintRef = new WeakReference<JBPopup>(hint);