From a0556fcbe1a404a023785e4ac983b20873976df7 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Tue, 20 Sep 2011 17:05:01 +0700 Subject: [PATCH] repeat last command if empty line was entered --- lib/_debugger.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/_debugger.js b/lib/_debugger.js index 3e28a3f4cb6..4deb0ec87ed 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -852,6 +852,13 @@ Interface.prototype.requireConnection = function() { // Used for debugger's commands evaluation and execution Interface.prototype.controlEval = function(code, context, filename, callback) { try { + // Repeat last command if empty line are going to be evaluated + if (this.repl.rli.history.length > 0) { + if (code === '(undefined\n)') { + code = '(' + this.repl.rli.history[0] + '\n)'; + } + } + var result = vm.runInContext(code, context, filename); // Repl should not ask for next command