feat: multi-suggest

This commit is contained in:
iff 2024-12-06 23:37:28 +01:00
parent e6ed9d617b
commit 1ddfbef7e7
8 changed files with 111 additions and 81 deletions

View file

@ -8,6 +8,7 @@ pub fn highlight_difference(
shell: &str,
suggested_command: &str,
last_command: &str,
difference_only: bool,
) -> Option<String> {
// let replaced_newline = suggested_command.replace('\n', r" {{newline}} ");
let mut split_suggested_command = split_command(suggested_command);
@ -42,7 +43,9 @@ pub fn highlight_difference(
}
for old in &old_entries {
if old == entry {
*entry = entry.blue().to_string();
if !difference_only {
*entry = entry.blue().to_string();
}
continue 'next;
}
}