summaryrefslogtreecommitdiff
path: root/lib/readline.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2020-01-11 13:36:21 +0100
committerRuben Bridgewater <ruben@bridgewater.de>2020-01-13 08:59:45 +0100
commitc3b702f9b4fbdbd6e5cb06d48daf06f7ae0f51cb (patch)
tree6d4aad9233973c9d190265177de4ffe93c131728 /lib/readline.js
parenta67c5dc06480314e1cb62ff3ece2431cb4edc8b2 (diff)
downloadnode-new-c3b702f9b4fbdbd6e5cb06d48daf06f7ae0f51cb.tar.gz
repl: do not preview while pasting code
This makes sure no previews are triggered while pasting code. The very last character is allowed to trigger the preview. The output should be completely identical to the user. PR-URL: https://github.com/nodejs/node/pull/31315 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Diffstat (limited to 'lib/readline.js')
-rw-r--r--lib/readline.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/readline.js b/lib/readline.js
index 9a8b83834d..574667f51b 100644
--- a/lib/readline.js
+++ b/lib/readline.js
@@ -97,6 +97,8 @@ function Interface(input, output, completer, terminal) {
}
this._sawReturnAt = 0;
+ // TODO(BridgeAR): Document this property. The name is not ideal, so we might
+ // want to expose an alias and document that instead.
this.isCompletionEnabled = true;
this._sawKeyPress = false;
this._previousKey = null;
@@ -1044,8 +1046,7 @@ Interface.prototype._ttyWrite = function(s, key) {
this._tabComplete(lastKeypressWasTab);
break;
}
- // falls through
-
+ // falls through
default:
if (typeof s === 'string' && s) {
const lines = s.split(/\r\n|\n|\r/);