Skip to content

Commit

Permalink
Change noCompletion to showCompletion
Browse files Browse the repository at this point in the history
Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
meixg and BridgeAR committed Feb 28, 2023
1 parent d636ce8 commit 7eef4d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/internal/repl/utils.js
Expand Up @@ -365,7 +365,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
}, () => callback(new ERR_INSPECTOR_NOT_AVAILABLE()));
}

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

// Add the autocompletion preview.
const insertPreview = false;
!noCompletion && showCompletionPreview(repl.line, insertPreview);
if (showCompletion) {
showCompletionPreview(repl.line, insertPreview);
}

// Do not preview if the command is buffered.
if (repl[bufferSymbol]) {
Expand Down
3 changes: 2 additions & 1 deletion lib/repl.js
Expand Up @@ -993,7 +993,8 @@ function REPLServer(prompt,
clearPreview(key);
if (!reverseSearch(d, key)) {
ttyWrite(d, key);
showPreview(key.name === 'escape');
const showCompletionPreview = key.name !== 'escape';
showPreview(showCompletionPreview);
}
return;
}
Expand Down

0 comments on commit 7eef4d7

Please sign in to comment.