Browse Source

[debugger] call silent resume in debugEval to prevent incorrect cursor position after repl autocompletion, small refactor in readline

Fedor Indutny 13 years ago
parent
commit
8d7aade663
  1. 10
      lib/_debugger.js
  2. 3
      lib/readline.js

10
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);
});
});
};

3
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();
}
});
};

Loading…
Cancel
Save