forked from tools/josh
1
0
Fork 0

Do not store duplicates in input history

Fixes #74.
This commit is contained in:
Florine W. Dekker 2019-11-12 01:24:09 +01:00
parent 7da2c7e16d
commit ca6eefee1f
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "fwdekker.com",
"version": "1.11.0",
"version": "1.11.1",
"description": "The source code of [my personal website](https://fwdekker.com/).",
"author": "Felix W. Dekker",
"repository": {

View File

@ -362,7 +362,7 @@ export class InputHistory {
* @param entry the entry to add
*/
addEntry(entry: string): void {
if (entry.trim() !== "")
if (entry.trim() !== "" && entry.trim() !== this.history[this.history.length - 1]?.trim())
this.history.unshift(entry);
this.index = -1;