Skip to content

Commit

Permalink
Only check for duplicates in suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
saep committed Feb 2, 2024
1 parent 1810d9d commit 89ca9ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/completion/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ impl<'menu> Completer for HistoryCompleter<'menu> {
let mut seen_command_lines = HashSet::new();
values
.into_iter()
.filter(|value| seen_command_lines.insert(value.command_line.clone()))
.map(|value| self.create_suggestion(line, pos, value.command_line.deref()))
.filter(|suggestion| seen_command_lines.insert(suggestion.value.clone()))
.collect()
}

Expand Down

0 comments on commit 89ca9ab

Please sign in to comment.