From: Fedor Indutny Date: Thu, 8 Sep 2011 20:05:21 +0000 (+0700) Subject: [debugger] call silent resume in debugEval to prevent incorrect cursor position after... X-Git-Tag: v0.5.7~61^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d7aade6634e6daa57164a2c9e634cae360a7c80;p=platform%2Fupstream%2Fnodejs.git [debugger] call silent resume in debugEval to prevent incorrect cursor position after repl autocompletion, small refactor in readline --- diff --git a/lib/_debugger.js b/lib/_debugger.js index be5d946..19dbc68 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -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); }); }); }; diff --git a/lib/readline.js b/lib/readline.js index 8781b90..e2b634a 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -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(); } }); };