Skip to content

Commit 3ede267

Browse files
meixgBridgeAR
andcommitted
Change noCompletion to showCompletion
Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 90c08fe commit 3ede267

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/internal/repl/utils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
363363
}, () => callback(new ERR_INSPECTOR_NOT_AVAILABLE()));
364364
}
365365

366-
const showPreview = (noCompletion = false) => {
366+
const showPreview = (showCompletion = true) => {
367367
// Prevent duplicated previews after a refresh.
368368
if (inputPreview !== null || !repl.isCompletionEnabled) {
369369
return;
@@ -380,7 +380,9 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
380380

381381
// Add the autocompletion preview.
382382
const insertPreview = false;
383-
!noCompletion && showCompletionPreview(repl.line, insertPreview);
383+
if (showCompletion) {
384+
showCompletionPreview(repl.line, insertPreview);
385+
}
384386

385387
// Do not preview if the command is buffered.
386388
if (repl[bufferSymbol]) {

lib/repl.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,8 @@ function REPLServer(prompt,
993993
clearPreview(key);
994994
if (!reverseSearch(d, key)) {
995995
ttyWrite(d, key);
996-
showPreview(key.name === 'escape');
996+
const showCompletionPreview = key.name !== 'escape';
997+
showPreview(showCompletionPreview);
997998
}
998999
return;
9991000
}

0 commit comments

Comments
 (0)