From b72950d544aa0c290fbb7b5b1aa9d7bf4e2684f4 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 14 Feb 2013 14:28:08 +0100 Subject: [PATCH] select first item when pressing down on a completely non-focused lookup (IDEA-101043) --- .../intellij/codeInsight/lookup/impl/LookupActionHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupActionHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupActionHandler.java index d03e6f0f2966..02ae9a8d5ebf 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupActionHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupActionHandler.java @@ -85,9 +85,13 @@ public abstract class LookupActionHandler extends EditorActionHandler { static void executeDown(LookupImpl lookup) { if (!lookup.isFocused()) { + boolean semiFocused = CompletionPreview.hasPreview(lookup); lookup.setFocused(true); lookup.getList().setSelectedIndex(0); lookup.refreshUi(false, true); + if (!semiFocused) { + return; + } } ListScrollingUtil.moveDown(lookup.getList(), 0); }