mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 10:40:54 +00:00
Sort themes by light/dark first and then alphabetically
This commit is contained in:
parent
d8eb749640
commit
bf27edfdee
1 changed files with 6 additions and 1 deletions
|
@ -36,7 +36,12 @@ impl ThemeSelector {
|
|||
let handle = cx.weak_handle();
|
||||
let picker = cx.add_view(|cx| Picker::new(handle, cx));
|
||||
let original_theme = cx.global::<Settings>().theme.clone();
|
||||
let theme_names = registry.list().collect::<Vec<_>>();
|
||||
let mut theme_names = registry.list().collect::<Vec<_>>();
|
||||
theme_names.sort_unstable_by(|a, b| {
|
||||
a.ends_with("dark")
|
||||
.cmp(&b.ends_with("dark"))
|
||||
.then_with(|| a.cmp(&b))
|
||||
});
|
||||
let matches = theme_names
|
||||
.iter()
|
||||
.map(|name| StringMatch {
|
||||
|
|
Loading…
Reference in a new issue