We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d3d54f commit 210f21fCopy full SHA for 210f21f
lua/blink/cmp/fuzzy/fuzzy.rs
@@ -85,7 +85,17 @@ pub fn fuzzy(
85
matches.sort_by_cached_key(|mtch| Reverse(match_scores[mtch.index]));
86
}
87
"label" => {
88
- matches.sort_by_key(|mtch| haystack[mtch.index_in_haystack].label.clone());
+ matches.sort_by(|a, b| {
89
+ let label_a = &haystack[a.index_in_haystack].label;
90
+ let label_b = &haystack[b.index_in_haystack].label;
91
+
92
+ // Put anything with an underscore at the end
93
+ match (label_a.starts_with('_'), label_b.starts_with('_')) {
94
+ (true, false) => std::cmp::Ordering::Greater,
95
+ (false, true) => std::cmp::Ordering::Less,
96
+ _ => label_a.cmp(label_b),
97
+ }
98
+ });
99
100
_ => {}
101
0 commit comments