Skip to content

Commit

Permalink
Only use case-insensitive matching when query is all lower case
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Saveau <[email protected]>
  • Loading branch information
SUPERCILEX committed Jul 1, 2024
1 parent 1451f48 commit 6e17500
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions egui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,12 @@ fn handle_command(
}

let query = if regex {
Query::Regex(Regex::new(query.trim())?)
} else {
Query::Regex(Regex::new(&query)?)
} else if query.chars().all(char::is_lowercase) {
query.make_ascii_lowercase();
Query::PlainIgnoreCase(query.trim().as_bytes())
} else {
Query::Plain(query.trim().as_bytes())
};
Ok(Some(Message::SearchResults(do_search(
query,
Expand Down

0 comments on commit 6e17500

Please sign in to comment.