From c700754a823a50af192fce509e5cb51ffcccbd61 Mon Sep 17 00:00:00 2001 From: peter Date: Mon, 13 Aug 2012 16:37:12 +0200 Subject: [PATCH] fix up arrow jumping to the first suggestion in in-place rename --- .../src/com/intellij/codeInsight/lookup/LookupArranger.java | 2 +- .../intellij/codeInsight/lookup/impl/LookupActionHandler.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/LookupArranger.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/LookupArranger.java index c655ec9f9f71..1842bb876025 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/LookupArranger.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/LookupArranger.java @@ -122,7 +122,7 @@ public abstract class LookupArranger { } result.addAll(items); ArrayList list = new ArrayList(result); - int selected = onExplicitAction ? 0 : list.indexOf(lookup.getCurrentItem()); + int selected = !lookup.isSelectionTouched() && onExplicitAction ? 0 : list.indexOf(lookup.getCurrentItem()); return new Pair, Integer>(list, selected >= 0 ? selected : 0); } 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 c3face8ec298..bcadd3cb13b8 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 @@ -147,6 +147,7 @@ public abstract class LookupActionHandler extends EditorActionHandler { lookup.setFocused(true); lookup.getList().setSelectedIndex(0); } + lookup.markSelectionTouched(); ListScrollingUtil.moveUp(lookup.getList(), 0); lookup.refreshUi(false, true); return true;