utilities: ensure command suggestions are LIFO

memfd
Manos Pitsidianakis 2020-09-15 13:02:16 +03:00
parent f83df69d2f
commit 07742ec053
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 1 additions and 0 deletions

View File

@ -799,6 +799,7 @@ impl Component for StatusBar {
let mut suggestions: Vec<AutoCompleteEntry> = self let mut suggestions: Vec<AutoCompleteEntry> = self
.cmd_history .cmd_history
.iter() .iter()
.rev()
.filter_map(|h| { .filter_map(|h| {
let sug = self.ex_buffer.as_str(); let sug = self.ex_buffer.as_str();
if h.starts_with(sug) && !unique_suggestions.contains(sug) { if h.starts_with(sug) && !unique_suggestions.contains(sug) {