IDEA-137120 AutoComplete does not offer options, there is a word begins with an underscore

This commit is contained in:
peter
2015-03-03 18:48:51 +01:00
parent 65abff4ac3
commit 54f4e283bc
2 changed files with 7 additions and 1 deletions
@@ -280,6 +280,7 @@ public class NameUtilMatchingTest extends UsefulTestCase {
assertMatches("*_dark", "collapseAll_dark.png");
assertMatches("*_dark.png", "collapseAll_dark.png");
assertMatches("**_dark.png", "collapseAll_dark.png");
assertTrue(firstLetterMatcher("*_DARK").matches("A_DARK.png"));
}
public void testMiddleMatching() {
@@ -410,13 +410,18 @@ public class MinusculeMatcher implements Matcher {
if (!charEquals(patternChar, patternIndex, name.charAt(nameIndex), ignoreCase)) return false;
if (myOptions == NameUtil.MatchingCaseSensitivity.FIRST_LETTER &&
(patternIndex == 0 || patternIndex == 1 && isWildcard(0)) &&
(patternIndex == 0 || patternIndex == 1 && isWildcard(0)) &&
hasCase(patternChar) &&
Character.isUpperCase(patternChar) != Character.isUpperCase(name.charAt(0))) {
return false;
}
return true;
}
private static boolean hasCase(char patternChar) {
return Character.isUpperCase(patternChar) || Character.isLowerCase(patternChar);
}
private boolean isWildcard(int patternIndex) {
if (patternIndex >= 0 && patternIndex < myPattern.length) {
char pc = myPattern[patternIndex];