|
@ -389,16 +389,22 @@ REPLServer.prototype.resetContext = function() { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
REPLServer.prototype.displayPrompt = function(preserveCursor) { |
|
|
REPLServer.prototype.displayPrompt = function(preserveCursor) { |
|
|
var initial = this._prompt; |
|
|
var prompt = this._initialPrompt; |
|
|
var prompt = initial; |
|
|
|
|
|
if (this.bufferedCommand.length) { |
|
|
if (this.bufferedCommand.length) { |
|
|
prompt = '...'; |
|
|
prompt = '...'; |
|
|
var levelInd = new Array(this.lines.level.length).join('..'); |
|
|
var levelInd = new Array(this.lines.level.length).join('..'); |
|
|
prompt += levelInd + ' '; |
|
|
prompt += levelInd + ' '; |
|
|
} |
|
|
} |
|
|
this.setPrompt(prompt); |
|
|
|
|
|
|
|
|
// Do not overwrite `_initialPrompt` here
|
|
|
|
|
|
REPLServer.super_.prototype.setPrompt.call(this, prompt); |
|
|
this.prompt(preserveCursor); |
|
|
this.prompt(preserveCursor); |
|
|
this.setPrompt(initial); |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// When invoked as an API method, overwrite _initialPrompt
|
|
|
|
|
|
REPLServer.prototype.setPrompt = function setPrompt(prompt) { |
|
|
|
|
|
this._initialPrompt = prompt; |
|
|
|
|
|
REPLServer.super_.prototype.setPrompt.call(this, prompt); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// A stream to push an array into a REPL
|
|
|
// A stream to push an array into a REPL
|
|
|