From a3a06b1bce5efc21fdcbb4413cf0d79f3e67403c Mon Sep 17 00:00:00 2001 From: "peter.gromov" Date: Thu, 21 Oct 2010 18:32:37 +0400 Subject: [PATCH] more stable lookup position --- .../completion/CodeCompletionHandlerBase.java | 1 - .../com/intellij/codeInsight/lookup/impl/LookupImpl.java | 9 ++------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java index 109433c646cd..f1a607a6f829 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java @@ -199,7 +199,6 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler { LookupImpl lookup = (LookupImpl)LookupManager.getInstance(editor.getProject()).createLookup(editor, LookupElement.EMPTY_ARRAY, "", LookupArranger.DEFAULT); if (editor.isOneLineMode()) { - lookup.setForceShowAsPopup(true); lookup.setCancelOnClickOutside(true); lookup.setCancelOnOtherWindowOpen(true); lookup.setResizable(false); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java index 520d65ad1511..76e808e900ab 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java @@ -550,13 +550,6 @@ public class LookupImpl extends LightweightHint implements Lookup, Disposable { return myLookupStartMarker.getStartOffset(); } - @Override - protected void beforeShow() { - if (isRealPopup()) { - getComponent().setBorder(null); - } - } - public void performGuardedChange(Runnable change) { assert !myChangeGuard; myChangeGuard = true; @@ -648,6 +641,8 @@ public class LookupImpl extends LightweightHint implements Lookup, Disposable { if (ApplicationManager.getApplication().isUnitTestMode()) return; + getComponent().setBorder(null); + Point p = calculatePosition(); HintManagerImpl hintManager = HintManagerImpl.getInstanceImpl(); hintManager.showEditorHint(this, myEditor, p, HintManagerImpl.HIDE_BY_ESCAPE | HintManagerImpl.UPDATE_BY_SCROLLING, 0, false);