From 8fba9c66bcc81d17d852b404223c6345db3f05bb Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 16 Dec 2011 15:31:33 +0100 Subject: [PATCH] don't close the quick doc when selecting another lookup element by mouse (IDEA-64008) --- .../codeInsight/documentation/DocumentationManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java index abe3fc8b8f5d..4b5cae8b6ec4 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java @@ -297,7 +297,8 @@ public class DocumentationManager { } }, keyboardShortcut != null ? keyboardShortcut.getFirstKeyStroke() : null)); // Null keyStroke is ok here - final JBPopup hint = JBPopupFactory.getInstance().createComponentPopupBuilder(component, component) + boolean hasLookup = LookupManager.getActiveLookup(myEditor) != null; + final JBPopup hint = JBPopupFactory.getInstance().createComponentPopupBuilder(component, component) .setRequestFocusCondition(project, NotLookupOrSearchCondition.INSTANCE) .setProject(project) .addListener(updateProcessor) @@ -308,6 +309,7 @@ public class DocumentationManager { .setResizable(true) .setMovable(true) .setRequestFocus(requestFocus) + .setCancelOnClickOutside(!hasLookup) // otherwise selecting lookup items by mouse would close the doc .setTitle(getTitle(element, false)) .setCouldPin(pinCallback) .setCancelCallback(new Computable() {