Skip to content

Commit

Permalink
fix(picker): no longer trim search pattern (#11406)
Browse files Browse the repository at this point in the history
  • Loading branch information
RoloEdits authored Aug 9, 2024
1 parent d6431f4 commit f522519
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions helix-term/src/ui/picker/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,16 @@ impl PickerQuery {
() => {
let key = field.take().unwrap_or(primary_field);

// Trims one space from the end, enabling leading and trailing
// spaces in search patterns, while also retaining spaces as separators
// between column filters.
let pat = text.strip_suffix(' ').unwrap_or(&text);

if let Some(pattern) = fields.get_mut(key) {
pattern.push(' ');
pattern.push_str(text.trim());
pattern.push_str(pat);
} else {
fields.insert(key.clone(), text.trim().to_string());
fields.insert(key.clone(), pat.to_string());
}
text.clear();
};
Expand Down

0 comments on commit f522519

Please sign in to comment.