[debugger] call silent resume in debugEval to prevent incorrect cursor position after...
authorFedor Indutny <fedor.indutny@gmail.com>
Thu, 8 Sep 2011 20:05:21 +0000 (03:05 +0700)
committerFedor Indutny <fedor.indutny@gmail.com>
Thu, 8 Sep 2011 20:05:21 +0000 (03:05 +0700)
lib/_debugger.js
lib/readline.js

index be5d946..19dbc68 100644 (file)
@@ -687,10 +687,12 @@ Interface.prototype.pause = function() {
   process.stdin.pause();
 };
 
-Interface.prototype.resume = function() {
+Interface.prototype.resume = function(silent) {
   if (this.paused === 0 || --this.paused !== 0) return false;
   this.repl.rli.resume();
-  this.repl.displayPrompt();
+  if (silent !== true) {
+    this.repl.displayPrompt();
+  }
   process.stdin.resume();
 
   if (this.waiting) {
@@ -752,13 +754,13 @@ Interface.prototype.debugEval = function(code, context, filename, callback) {
       } else {
         callback(null);
       }
-      self.resume();
+      self.resume(true);
       return;
     }
 
     client.mirrorObject(res.body, function(mirror) {
       callback(null, mirror);
-      self.resume();
+      self.resume(true);
     });
   });
 };
index 8781b90..e2b634a 100644 (file)
@@ -265,7 +265,6 @@ Interface.prototype._tabComplete = function() {
       // Apply/show completions.
       if (completions.length === 1) {
         self._insertString(completions[0].slice(completeOn.length));
-        self._refreshLine();
       } else {
         self.output.write('\r\n');
         var width = completions.reduce(function(a, b) {
@@ -317,8 +316,8 @@ Interface.prototype._tabComplete = function() {
           self._insertString(prefix.slice(completeOn.length));
         }
 
-        self._refreshLine();
       }
+      self._refreshLine();
     }
   });
 };