Commit 2e54a99
readline,repl: improve history up/previous
Reaching the history end caused the last entry to be persistent.
That way there's no actualy feedback to the user that the history
end is reached. Instead, visualize the original input line and keep
the history index at the history end in case the user wants to go
back again.
PR-URL: #31112
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent cecd256 commit 2e54a99Copy full SHA for 2e54a99
File tree
Expand file treeCollapse file tree
5 files changed
+90
-28
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
5 files changed
+90
-28
lines changedOpen diff view settings
Collapse file
+2-4Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
718 | 718 | |
719 | 719 | |
720 | 720 | |
721 | | - |
| 721 | + |
722 | 722 | |
723 | 723 | |
724 | 724 | |
| ||
727 | 727 | |
728 | 728 | |
729 | 729 | |
730 | | - |
731 | | - |
732 | | - |
| 730 | + |
733 | 731 | |
734 | 732 | |
735 | 733 | |
|
Collapse file
test/parallel/test-readline-interface.js
Copy file name to clipboardExpand all lines: test/parallel/test-readline-interface.js+14-6Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
482 | 482 | |
483 | 483 | |
484 | 484 | |
485 | | - |
486 | | - |
487 | | - |
488 | | - |
489 | | - |
490 | | - |
| 485 | + |
| 486 | + |
| 487 | + |
| 488 | + |
| 489 | + |
| 490 | + |
| 491 | + |
| 492 | + |
| 493 | + |
| 494 | + |
| 495 | + |
| 496 | + |
| 497 | + |
| 498 | + |
491 | 499 | |
492 | 500 | |
493 | 501 | |
|
Collapse file
test/parallel/test-repl-history-navigation.js
Copy file name to clipboardExpand all lines: test/parallel/test-repl-history-navigation.js+9-5Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
78 | 78 | |
79 | 79 | |
80 | 80 | |
81 | | - |
82 | | - |
| 81 | + |
83 | 82 | |
84 | 83 | |
85 | 84 | |
| ||
92 | 91 | |
93 | 92 | |
94 | 93 | |
| 94 | + |
| 95 | + |
95 | 96 | |
96 | 97 | |
97 | 98 | |
| ||
138 | 139 | |
139 | 140 | |
140 | 141 | |
141 | | - |
142 | | - |
143 | | - |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
144 | 148 | |
145 | 149 | |
146 | 150 | |
|
Collapse file
test/parallel/test-repl-persistent-history.js
Copy file name to clipboardExpand all lines: test/parallel/test-repl-persistent-history.js+34-7Lines changed: 34 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
10 | 10 | |
11 | 11 | |
12 | 12 | |
| 13 | + |
13 | 14 | |
14 | 15 | |
15 | 16 | |
| ||
51 | 52 | |
52 | 53 | |
53 | 54 | |
| 55 | + |
54 | 56 | |
55 | 57 | |
56 | 58 | |
| ||
90 | 92 | |
91 | 93 | |
92 | 94 | |
93 | | - |
94 | | - |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
95 | 101 | |
96 | 102 | |
97 | 103 | |
98 | 104 | |
99 | | - |
100 | | - |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
101 | 119 | |
102 | 120 | |
103 | 121 | |
104 | 122 | |
105 | | - |
106 | | - |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | + |
107 | 131 | |
108 | 132 | |
109 | 133 | |
| ||
169 | 193 | |
170 | 194 | |
171 | 195 | |
| 196 | + |
| 197 | + |
172 | 198 | |
173 | 199 | |
174 | 200 | |
| ||
193 | 219 | |
194 | 220 | |
195 | 221 | |
| 222 | + |
196 | 223 | |
197 | 224 | |
198 | 225 | |
| ||
207 | 234 | |
208 | 235 | |
209 | 236 | |
210 | | - |
| 237 | + |
211 | 238 | |
212 | 239 | |
213 | 240 | |
|
Collapse file
test/parallel/test-repl-programmatic-history.js
Copy file name to clipboardExpand all lines: test/parallel/test-repl-programmatic-history.js+31-6Lines changed: 31 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
8 | 8 | |
9 | 9 | |
10 | 10 | |
| 11 | + |
11 | 12 | |
12 | 13 | |
13 | 14 | |
| ||
49 | 50 | |
50 | 51 | |
51 | 52 | |
| 53 | + |
52 | 54 | |
53 | 55 | |
54 | 56 | |
| ||
88 | 90 | |
89 | 91 | |
90 | 92 | |
91 | | - |
92 | | - |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
93 | 101 | |
94 | 102 | |
95 | 103 | |
96 | 104 | |
97 | | - |
98 | | - |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
99 | 115 | |
100 | 116 | |
101 | 117 | |
102 | 118 | |
103 | | - |
104 | | - |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
105 | 127 | |
106 | 128 | |
107 | 129 | |
| ||
167 | 189 | |
168 | 190 | |
169 | 191 | |
| 192 | + |
| 193 | + |
170 | 194 | |
171 | 195 | |
172 | 196 | |
| ||
192 | 216 | |
193 | 217 | |
194 | 218 | |
| 219 | + |
195 | 220 | |
196 | 221 | |
197 | 222 | |
|
0 commit comments