diff options
Diffstat (limited to 'lib/readline.js')
-rw-r--r-- | lib/readline.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/readline.js b/lib/readline.js index 4012af8bce..67e71fee41 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -96,7 +96,7 @@ function Interface(input, output, completer, terminal) { let prompt = '> '; if (input && input.input) { - // an options object was given + // An options object was given output = input.output; completer = input.completer; terminal = input.terminal; @@ -222,7 +222,7 @@ function Interface(input, output, completer, terminal) { emitKeypressEvents(input, this); - // input usually refers to stdin + // `input` usually refers to stdin input.on('keypress', onkeypress); input.on('end', ontermend); @@ -496,7 +496,7 @@ Interface.prototype._tabComplete = function(lastKeypressWasTab) { } const completions = rv[0]; - const completeOn = rv[1]; // the text that was completed + const completeOn = rv[1]; // The text that was completed if (completions && completions.length) { // Apply/show completions. if (lastKeypressWasTab) { @@ -688,7 +688,7 @@ Interface.prototype._historyNext = function() { if (this.historyIndex > 0) { this.historyIndex--; this.line = this.history[this.historyIndex]; - this.cursor = this.line.length; // set cursor to end of line. + this.cursor = this.line.length; // Set cursor to end of line. this._refreshLine(); } else if (this.historyIndex === 0) { @@ -704,7 +704,7 @@ Interface.prototype._historyPrev = function() { if (this.historyIndex + 1 < this.history.length) { this.historyIndex++; this.line = this.history[this.historyIndex]; - this.cursor = this.line.length; // set cursor to end of line. + this.cursor = this.line.length; // Set cursor to end of line. this._refreshLine(); } @@ -814,7 +814,7 @@ function _ttyWriteDumb(s, key) { } switch (key.name) { - case 'return': // carriage return, i.e. \r + case 'return': // Carriage return, i.e. \r this._sawReturnAt = Date.now(); this._line(); break; @@ -837,7 +837,7 @@ function _ttyWriteDumb(s, key) { } } -// handle a write from the tty +// Handle a write from the tty Interface.prototype._ttyWrite = function(s, key) { const previousKey = this._previousKey; key = key || {}; @@ -893,11 +893,11 @@ Interface.prototype._ttyWrite = function(s, key) { this._deleteLineRight(); break; - case 'a': // go to the start of the line + case 'a': // Go to the start of the line this._moveCursor(-Infinity); break; - case 'e': // go to the end of the line + case 'e': // Go to the end of the line this._moveCursor(+Infinity); break; @@ -905,11 +905,11 @@ Interface.prototype._ttyWrite = function(s, key) { this._moveCursor(-charLengthLeft(this.line, this.cursor)); break; - case 'f': // forward one character + case 'f': // Forward one character this._moveCursor(+charLengthAt(this.line, this.cursor)); break; - case 'l': // clear the whole screen + case 'l': // Clear the whole screen cursorTo(this.output, 0, 0); clearScreenDown(this.output); this._refreshLine(); @@ -919,7 +919,7 @@ Interface.prototype._ttyWrite = function(s, key) { this._historyNext(); break; - case 'p': // previous history item + case 'p': // Previous history item this._historyPrev(); break; @@ -997,7 +997,7 @@ Interface.prototype._ttyWrite = function(s, key) { this._sawReturnAt = 0; switch (key.name) { - case 'return': // carriage return, i.e. \r + case 'return': // Carriage return, i.e. \r this._sawReturnAt = Date.now(); this._line(); break; |