mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
change preselection in goto popups when typing according to the matching degree (IDEA-163865)
This commit is contained in:
@@ -998,15 +998,10 @@ public abstract class ChooseByNameBase {
|
||||
Object[] oldElements = myListModel.getItems().toArray();
|
||||
Object[] newElements = elements.toArray();
|
||||
List<ModelDiff.Cmd> commands = ModelDiff.createDiffCmds(myListModel, oldElements, newElements);
|
||||
if (commands == null) {
|
||||
return; // Nothing changed
|
||||
}
|
||||
|
||||
myTextField.setForeground(UIUtil.getTextFieldForeground());
|
||||
if (commands.isEmpty()) {
|
||||
if (pos <= 0) {
|
||||
pos = calcSelectedIndex(newElements, getTrimmedText());
|
||||
}
|
||||
if (commands == null || commands.isEmpty()) {
|
||||
pos = calcSelectedIndex(newElements, getTrimmedText());
|
||||
|
||||
ScrollingUtil.selectItem(myList, Math.min(pos, myListModel.getSize() - 1));
|
||||
myList.setVisibleRowCount(Math.min(VISIBLE_LIST_SIZE_LIMIT, myList.getModel().getSize()));
|
||||
|
||||
Reference in New Issue
Block a user