Skip to content

history: Don't save duplicated entries in the history

When a command runs in the run dialog (Alt+F2), the command will be added to the command history regardless of any existing duplicates. Only when the last command was the same one, the current command won't be saved again. However, command chains, like: lg, r, lg, r, lg, r will still be saved, which might lead to, that a command positioned before such a chain will be hard to find.
So, remove equal entries when the same command runs again, so that we only have the command stored once (at the end of the history). Also remove duplicated entries once the history is loaded (first press of Alt+F2 when g-s runs) to make sure that existing histories where such chains already exist are cleaned up.

Closes: #524 (closed)

Edited by Pascal Nowack

Merge request reports