mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-07 00:06:24 +03:00
Merge pull request #916 from zed-industries/sort-themes
Sort themes by light/dark first and then alphabetically
This commit is contained in:
commit
7c3bdf91d9
@ -36,7 +36,12 @@ impl ThemeSelector {
|
|||||||
let handle = cx.weak_handle();
|
let handle = cx.weak_handle();
|
||||||
let picker = cx.add_view(|cx| Picker::new(handle, cx));
|
let picker = cx.add_view(|cx| Picker::new(handle, cx));
|
||||||
let original_theme = cx.global::<Settings>().theme.clone();
|
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
|
let matches = theme_names
|
||||||
.iter()
|
.iter()
|
||||||
.map(|name| StringMatch {
|
.map(|name| StringMatch {
|
||||||
|
Loading…
Reference in New Issue
Block a user