fix up arrow jumping to the first suggestion in in-place rename

This commit is contained in:
peter
2012-08-13 17:55:25 +02:00
parent 0e1fd1d887
commit c700754a82
2 changed files with 2 additions and 1 deletions
@@ -122,7 +122,7 @@ public abstract class LookupArranger {
}
result.addAll(items);
ArrayList<LookupElement> list = new ArrayList<LookupElement>(result);
int selected = onExplicitAction ? 0 : list.indexOf(lookup.getCurrentItem());
int selected = !lookup.isSelectionTouched() && onExplicitAction ? 0 : list.indexOf(lookup.getCurrentItem());
return new Pair<List<LookupElement>, Integer>(list, selected >= 0 ? selected : 0);
}
@@ -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;