Skip to content

Commit

Permalink
sort named function dropdown differently
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Sep 24, 2024
1 parent 9e8a657 commit 25e9c51
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion site/src/editor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,10 @@ pub fn Editor<'a>(
let mut named_prims: Vec<Primitive> = Primitive::non_deprecated()
.filter(|prim| prim.glyph().is_none())
.collect();
named_prims.sort_by_key(|prim| prim.name().trim_start_matches("&"));
named_prims.sort_by(|a, b| {
(a.name().starts_with('&').cmp(&b.name().starts_with('&')))
.then_with(|| a.name().cmp(b.name()))
});
let max_name_len = named_prims
.iter()
.map(|prim| prim.name().chars().count())
Expand Down

0 comments on commit 25e9c51

Please sign in to comment.