Skip to content

Commit 34ba230

Browse files
jenthonedanielleadams
authored andcommitted
repl: remove lastInputPreview conditional check
PR-URL: #46857 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Kohei Ueno <[email protected]>
1 parent 09739a2 commit 34ba230

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

lib/internal/repl/utils.js

+2-5
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

+1-2
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)