Auto completion of built-in debugger suggests prefix match rather than partial match.
authorkoichik <koichik@improvement.jp>
Wed, 30 Mar 2011 13:17:00 +0000 (22:17 +0900)
committerRyan Dahl <ry@tinyclouds.org>
Tue, 12 Apr 2011 00:28:28 +0000 (17:28 -0700)
lib/_debugger.js

index f155ca2..859dc2c 100644 (file)
@@ -652,7 +652,7 @@ Interface.prototype.complete = function(line) {
   line = line.replace(/^\s*/, '');
 
   for (var i = 0; i < commands.length; i++) {
-    if (commands[i].indexOf(line) >= 0) {
+    if (commands[i].indexOf(line) === 0) {
       matches.push(commands[i]);
     }
   }