mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
[debugger] call silent resume in debugEval to prevent incorrect cursor position after repl autocompletion, small refactor in readline
This commit is contained in:
parent
01349bbd70
commit
8d7aade663
@ -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);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -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…
Reference in New Issue
Block a user