Merge remote-tracking branch 'origin/master' idea/110.105 pycharm/110.108 rubymine/110.107
authorYann Cebron <yann.cebron@googlemail.com>
Wed, 12 Oct 2011 19:30:05 +0000 (21:30 +0200)
committerYann Cebron <yann.cebron@googlemail.com>
Wed, 12 Oct 2011 19:30:05 +0000 (21:30 +0200)
bin/nix/idea.sh
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java

index 18d98a1f40ba5778a821723cc15cd27e0400e273..3a16ccb56aa0f4d078b99b4b237e274d69583526 100755 (executable)
@@ -23,9 +23,16 @@ if [ -z "$JDK" ]; then
     JAVA_BIN_PATH=`which java`
     if [ -n "$JAVA_BIN_PATH" ]; then
       if [ "$OS_TYPE" = "MAC" ]; then
-        JAVA_LOCATION=`readlink "$JAVA_BIN_PATH" | xargs dirname | xargs dirname | xargs dirname`
-        if [ -x "$JAVA_LOCATION/CurrentJDK/Home/bin/java" ]; then
-          JDK="$JAVA_LOCATION/CurrentJDK/Home"
+        if [ -h "$JAVA_BIN_PATH" ] ; then
+          JAVA_LOCATION=`readlink "$JAVA_BIN_PATH" | xargs dirname | xargs dirname | xargs dirname`
+          if [ -x "$JAVA_LOCATION/CurrentJDK/Home/bin/java" ]; then
+            JDK="$JAVA_LOCATION/CurrentJDK/Home"
+          fi
+        else
+          JAVA_LOCATION=`echo "$JAVA_BIN_PATH" | xargs dirname | xargs dirname`
+          if [ -f "$JAVA_LOCATION/lib/tools.jar" ]; then
+            JDK="$JAVA_LOCATION"
+          fi
         fi
       else
         JAVA_LOCATION=`readlink -f "$JAVA_BIN_PATH"`
index 2e566f311c0cf65f1f2edbc3550e3266e4482f7b..cd35ff8e93b8953cdeb4971eb154b7e6cefe7536 100644 (file)
@@ -1086,13 +1086,13 @@ public class LookupImpl extends LightweightHint implements LookupEx, Disposable
     final PrefixMatcher firstItemMatcher = itemMatcher(firstItem);
     final String oldPrefix = firstItemMatcher.getPrefix();
     final String presentPrefix = oldPrefix + myAdditionalPrefix;
-    String commonPrefix = firstItem.getLookupString();
+    String commonPrefix = handleCaseInsensitiveVariant(itemMatcher(firstItem).getPrefix(), firstItem.getLookupString());
 
     for (int i = 1; i < listModel.getSize(); i++) {
       LookupElement item = (LookupElement)listModel.getElementAt(i);
       if (!oldPrefix.equals(itemMatcher(item).getPrefix())) return false;
 
-      final String lookupString = item.getLookupString();
+      final String lookupString = handleCaseInsensitiveVariant(itemMatcher(item).getPrefix(), item.getLookupString());
       final int length = Math.min(commonPrefix.length(), lookupString.length());
       if (length < commonPrefix.length()) {
         commonPrefix = commonPrefix.substring(0, length);