mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
select the exact prefix match, even if case-insensitive
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
class Foo {
|
||||
void foo1() {}
|
||||
void foo2() {}
|
||||
|
||||
{
|
||||
foo<caret>
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -249,4 +249,14 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
|
||||
assertEquals(((JavaPsiClassReferenceElement)items.get(1)).getQualifiedName(), "bar.Bar");
|
||||
}
|
||||
|
||||
public void testCaseInsensitivePrefixMatch() {
|
||||
CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE = CodeInsightSettings.NONE;
|
||||
try {
|
||||
checkPreferredItems(0, "Foo", "foo1", "foo2");
|
||||
}
|
||||
finally {
|
||||
CodeInsightSettings.getInstance().COMPLETION_CASE_SENSITIVE = CodeInsightSettings.FIRST_LETTER;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -427,7 +427,8 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable
|
||||
if (!model.isEmpty()) {
|
||||
myList.setFixedCellWidth(Math.max(myLookupTextWidth + myCellRenderer.getIconIndent(), myAdComponent.getAdComponent().getPreferredSize().width));
|
||||
|
||||
if (isFocused() && (!isExactPrefixItem(model.iterator().next(), true) || mySelectionTouched)) {
|
||||
LookupElement first = model.iterator().next();
|
||||
if (isFocused() && (!(isExactPrefixItem(first, true) || isExactPrefixItem(first, false)) || mySelectionTouched)) {
|
||||
restoreSelection(oldSelected, hasPreselected, oldInvariant, snapshot.second);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user