mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-14 22:14:23 +00:00
Only enable smart case if the query contains an uppercase character
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
f934370e7f
commit
b52db22544
1 changed files with 2 additions and 1 deletions
|
@ -63,6 +63,7 @@ impl<T> Outline<T> {
|
||||||
pub async fn search(&self, query: &str, executor: Arc<Background>) -> Vec<StringMatch> {
|
pub async fn search(&self, query: &str, executor: Arc<Background>) -> Vec<StringMatch> {
|
||||||
let query = query.trim_start();
|
let query = query.trim_start();
|
||||||
let is_path_query = query.contains(' ');
|
let is_path_query = query.contains(' ');
|
||||||
|
let smart_case = query.chars().any(|c| c.is_uppercase());
|
||||||
let mut matches = fuzzy::match_strings(
|
let mut matches = fuzzy::match_strings(
|
||||||
if is_path_query {
|
if is_path_query {
|
||||||
&self.path_candidates
|
&self.path_candidates
|
||||||
|
@ -70,7 +71,7 @@ impl<T> Outline<T> {
|
||||||
&self.candidates
|
&self.candidates
|
||||||
},
|
},
|
||||||
query,
|
query,
|
||||||
true,
|
smart_case,
|
||||||
100,
|
100,
|
||||||
&Default::default(),
|
&Default::default(),
|
||||||
executor.clone(),
|
executor.clone(),
|
||||||
|
|
Loading…
Reference in a new issue