Skip to content

Commit a6c7f1c

Browse files
committed
Sort terminals alphabetically in preferences
If you're looking for a specific terminal, it can be confusing since there's no logical sorting for the list of terminals.
1 parent 553910c commit a6c7f1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/terminal_combo_row.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ mod imp {
3131
obj.set_title("Preferred Terminal");
3232
obj.set_use_subtitle(true);
3333

34-
let terminals = SUPPORTED_TERMINALS
34+
let mut terminals = SUPPORTED_TERMINALS
3535
.iter()
3636
.map(|x| x.name.as_ref())
3737
.collect::<Vec<&str>>();
38+
// case-insensitive sort
39+
terminals.sort_by(|a, b| a.to_lowercase().cmp(&b.to_lowercase()));
3840
let selected_position = terminals.iter().position(|x| {
3941
Some(x)
4042
== obj

0 commit comments

Comments
 (0)