mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix up arrow jumping to the first suggestion in in-place rename
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user