summaryrefslogtreecommitdiff
path: root/lib/repl.js
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2011-12-09 15:24:15 +0600
committerRyan Dahl <ry@tinyclouds.org>2011-12-19 11:09:16 -0800
commitc07edd90f5bfb4edb98b57e76e56742e08142b91 (patch)
tree4dbfc6c67960716da6936c9b3dcbcb9fb931198f /lib/repl.js
parentd9377f5eb0ca6b0dbf529c09f8506a141903250b (diff)
downloadnode-new-c07edd90f5bfb4edb98b57e76e56742e08142b91.tar.gz
preserve cursor pos
* configurable via .prompt()'s preserveCursor argument (false by default)
Diffstat (limited to 'lib/repl.js')
-rw-r--r--lib/repl.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/repl.js b/lib/repl.js
index 3a5ac4346e..2c3baeba28 100644
--- a/lib/repl.js
+++ b/lib/repl.js
@@ -282,11 +282,11 @@ REPLServer.prototype.resetContext = function(force) {
this.context = context;
};
-REPLServer.prototype.displayPrompt = function() {
+REPLServer.prototype.displayPrompt = function(preserveCursor) {
this.rli.setPrompt(this.bufferedCommand.length ?
'...' + new Array(this.lines.level.length).join('..') + ' ' :
this.prompt);
- this.rli.prompt();
+ this.rli.prompt(preserveCursor);
};