Skip to content

Commit 56dbb15

Browse files
jenthonetargos
authored andcommitted
repl: remove lastInputPreview conditional check
PR-URL: #46857 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
1 parent c7d4ff3 commit 56dbb15

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

lib/internal/repl/utils.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
147147
}
148148

149149
let inputPreview = null;
150-
let lastInputPreview = '';
151150

152151
let previewCompletionCounter = 0;
153152
let completionPreview = null;
@@ -179,7 +178,6 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
179178
moveCursor(repl.output, 0, rows);
180179
clearLine(repl.output);
181180
moveCursor(repl.output, 0, -rows);
182-
lastInputPreview = inputPreview;
183181
inputPreview = null;
184182
}
185183
if (completionPreview !== null) {
@@ -396,9 +394,8 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
396394

397395
wrapped = false;
398396

399-
// Ignore the output if the value is identical to the current line and the
400-
// former preview is not identical to this preview.
401-
if (line === inspected && lastInputPreview !== inspected) {
397+
// Ignore the output if the value is identical to the current line.
398+
if (line === inspected) {
402399
return;
403400
}
404401

test/parallel/test-repl-reverse-search.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,7 @@ const tests = [
238238
'2\n',
239239
'\x1B[1G', '\x1B[0J',
240240
prompt, '\x1B[3G',
241-
'2', '\n// 2', '\x1B[4G', '\x1B[1A',
242-
'\x1B[1B', '\x1B[2K', '\x1B[1A',
241+
'2',
243242
'\nbck-i-search: _', '\x1B[1A', '\x1B[4G',
244243
'\x1B[3G', '\x1B[0J',
245244
'Array(100).fill(1)\nbck-i-search: r_', '\x1B[1A', '\x1B[5G',

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy