Skip to content

Commit 7eef4d7

Browse files
meixgBridgeAR
andauthored
Change noCompletion to showCompletion
Co-authored-by: Ruben Bridgewater <[email protected]>
1 parent d636ce8 commit 7eef4d7

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/internal/repl/utils.js

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

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

383383
// Add the autocompletion preview.
384384
const insertPreview = false;
385-
!noCompletion && showCompletionPreview(repl.line, insertPreview);
385+
if (showCompletion) {
386+
showCompletionPreview(repl.line, insertPreview);
387+
}
386388

387389
// Do not preview if the command is buffered.
388390
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)