Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 56dbb15

Browse filesBrowse 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
Copy full SHA for 56dbb15

File tree

Expand file treeCollapse file tree

2 files changed

+3
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-7
lines changed
Open diff view settings
Collapse file

‎lib/internal/repl/utils.js‎

Copy file name to clipboardExpand all lines: lib/internal/repl/utils.js
+2-5Lines 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

Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-repl-reverse-search.js
+1-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.