Skip to content

Commit 230d3f7

Browse files
committed
pref: remove adjacent duplicated history in cli
1 parent 90392cb commit 230d3f7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

frontend/src/components/content_value/ContentCli.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,10 @@ const newInputLine = () => {
522522
const pop = inputHistory.splice(historyIndex, 1)
523523
inputHistory[inputHistory.length - 1] = pop[0]
524524
}
525+
// remove adjacent duplicated history
526+
if (inputHistory.length > 1 && inputHistory[inputHistory.length - 1] === inputHistory[inputHistory.length - 2]) {
527+
inputHistory.pop()
528+
}
525529
if (get(inputHistory, inputHistory.length - 1, '')) {
526530
historyIndex = inputHistory.length
527531
updateCurrentInput('')

0 commit comments

Comments
 (0)