mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
when a lookup is just shown, scroll it to the selected item regardless whether it's autopopup or not
This commit is contained in:
+5
@@ -335,6 +335,7 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
if (isOutdated()) return;
|
||||
|
||||
boolean justShown = false;
|
||||
if (!myLookup.isShown() && (!isAutopopupCompletion() || !myLookup.isCalculating())) {
|
||||
if (hideAutopopupIfMeaningless()) {
|
||||
return;
|
||||
@@ -348,10 +349,14 @@ public class CompletionProgressIndicator extends ProgressIndicatorBase implement
|
||||
}
|
||||
|
||||
myLookup.show();
|
||||
justShown = true;
|
||||
}
|
||||
myLookup.refreshUi();
|
||||
hideAutopopupIfMeaningless();
|
||||
updateFocus();
|
||||
if (justShown) {
|
||||
myLookup.ensureSelectionVisible();
|
||||
}
|
||||
}
|
||||
|
||||
final boolean isInsideIdentifier() {
|
||||
|
||||
@@ -347,7 +347,7 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable
|
||||
myStartCompletionWhenNothingMatches = startCompletionWhenNothingMatches;
|
||||
}
|
||||
|
||||
private void ensureSelectionVisible() {
|
||||
public void ensureSelectionVisible() {
|
||||
ListScrollingUtil.ensureIndexIsVisible(myList, myList.getSelectedIndex(), 1);
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable
|
||||
if (choosePreselectedItem) {
|
||||
myList.setSelectedValue(myPreselectedItem, false);
|
||||
} else {
|
||||
ListScrollingUtil.selectItem(myList, doSelectMostPreferableItem(getItems(), groups));
|
||||
myList.setSelectedIndex(doSelectMostPreferableItem(getItems(), groups));
|
||||
}
|
||||
|
||||
if (myPreselectedItem != null && myShown) {
|
||||
|
||||
Reference in New Issue
Block a user