Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Various fixes for autocompletion behavior.

  • Loading branch information...
commit 258fed8eb5f31e70272e1efac9119439ac468892 1 parent 6aaf750
@norrisboyd norrisboyd authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 toolsrc/org/mozilla/javascript/tools/shell/ShellLine.java
View
7 toolsrc/org/mozilla/javascript/tools/shell/ShellLine.java
@@ -119,7 +119,7 @@ public Object invoke(Object proxy, Method method, Object[] args) {
if (method.equals(this.completeMethod)) {
int result = complete((String)args[0], ((Integer) args[1]).intValue(),
(List<String>) args[2]);
- return new Integer(result);
+ return Integer.valueOf(result);
}
throw new NoSuchMethodError(method.toString());
}
@@ -133,12 +133,13 @@ public int complete(String buffer, int cursor, List<String> candidates) {
// fragment as a prefix and return those for autocompletion.
int m = cursor - 1;
while (m >= 0) {
- char c = buffer.charAt(m--);
+ char c = buffer.charAt(m);
if (!Character.isJavaIdentifierPart(c) && c != '.')
break;
+ m--;
}
String namesAndDots = buffer.substring(m+1, cursor);
- String[] names = namesAndDots.split("\\.");
+ String[] names = namesAndDots.split("\\.", -1);
Scriptable obj = this.global;
for (int i=0; i < names.length - 1; i++) {
Object val = obj.get(names[i], global);
Please sign in to comment.
Something went wrong with that request. Please try again.