Skip to content

Commit

Permalink
Fix invisible results in picker
Browse files Browse the repository at this point in the history
  • Loading branch information
stratil-jakub-emplifi committed Feb 15, 2023
1 parent c73a0f3 commit a9be0fd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helix-term/src/ui/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ impl<T: Item> FilePicker<T> {

pub fn with_line(mut self, line: String, editor: &Editor) -> Self {
self.picker.set_line(line, editor);
self.picker.force_score();
self
}

Expand Down Expand Up @@ -455,10 +456,13 @@ impl<T: Item> Picker<T> {
}
acc
});
let widths = max_lens
let mut widths: Vec<Constraint> = max_lens
.into_iter()
.map(|len| Constraint::Length(len as u16))
.collect();
if widths.is_empty() {
widths.push(Constraint::Length(100));
}

let mut picker = Self {
options,
Expand Down

0 comments on commit a9be0fd

Please sign in to comment.