diff options
Diffstat (limited to 'lib/readline.js')
-rw-r--r-- | lib/readline.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/readline.js b/lib/readline.js index bf53b02ff..1a159c9a1 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -6,11 +6,11 @@ 'use strict'; -var kHistorySize = 30; +const kHistorySize = 30; -var util = require('util'); -var inherits = require('util').inherits; -var EventEmitter = require('events').EventEmitter; +const util = require('util'); +const inherits = util.inherits; +const EventEmitter = require('events').EventEmitter; exports.createInterface = function(input, output, completer, terminal) { @@ -294,7 +294,7 @@ Interface.prototype.write = function(d, key) { }; // \r\n, \n, or \r followed by something other than \n -var lineEnding = /\r?\n|\r(?!\n)/; +const lineEnding = /\r?\n|\r(?!\n)/; Interface.prototype._normalWrite = function(b) { if (util.isUndefined(b)) { return; @@ -939,15 +939,15 @@ exports.emitKeypressEvents = emitKeypressEvents; */ // Regexes used for ansi escape code splitting -var metaKeyCodeReAnywhere = /(?:\x1b)([a-zA-Z0-9])/; -var metaKeyCodeRe = new RegExp('^' + metaKeyCodeReAnywhere.source + '$'); -var functionKeyCodeReAnywhere = new RegExp('(?:\x1b+)(O|N|\\[|\\[\\[)(?:' + [ +const metaKeyCodeReAnywhere = /(?:\x1b)([a-zA-Z0-9])/; +const metaKeyCodeRe = new RegExp('^' + metaKeyCodeReAnywhere.source + '$'); +const functionKeyCodeReAnywhere = new RegExp('(?:\x1b+)(O|N|\\[|\\[\\[)(?:' + [ '(\\d+)(?:;(\\d+))?([~^$])', '(?:M([@ #!a`])(.)(.))', // mouse '(?:1;)?(\\d+)?([a-zA-Z])' ].join('|') + ')'); -var functionKeyCodeRe = new RegExp('^' + functionKeyCodeReAnywhere.source); -var escapeCodeReAnywhere = new RegExp([ +const functionKeyCodeRe = new RegExp('^' + functionKeyCodeReAnywhere.source); +const escapeCodeReAnywhere = new RegExp([ functionKeyCodeReAnywhere.source, metaKeyCodeReAnywhere.source, /\x1b./.source ].join('|')); |