diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2020-01-11 15:36:21 +0300 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2020-01-13 10:59:45 +0300 |
commit | c3b702f9b4fbdbd6e5cb06d48daf06f7ae0f51cb (patch) | |
tree | 6d4aad9233973c9d190265177de4ffe93c131728 /lib/internal/repl | |
parent | a67c5dc06480314e1cb62ff3ece2431cb4edc8b2 (diff) |
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/internal/repl')
-rw-r--r-- | lib/internal/repl/utils.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/internal/repl/utils.js b/lib/internal/repl/utils.js index 6082fe7908b..3449eab785f 100644 --- a/lib/internal/repl/utils.js +++ b/lib/internal/repl/utils.js @@ -298,10 +298,9 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) { }, () => callback(new ERR_INSPECTOR_NOT_AVAILABLE())); } - // TODO(BridgeAR): Prevent previews while pasting code. const showPreview = () => { // Prevent duplicated previews after a refresh. - if (inputPreview !== null) { + if (inputPreview !== null || !repl.isCompletionEnabled) { return; } |