diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 3db042a54854..e52f020b501c 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -73,6 +73,8 @@ impl From for PathOrId { /// File path and range of lines (used to align and highlight lines) pub type FileLocation = (PathOrId, Option<(usize, usize)>); +type FilePreviewFn = Box Option>; + pub enum CachedPreview { Document(Box), Binary, @@ -136,7 +138,7 @@ pub struct Picker { preview_cache: HashMap, read_buffer: Vec, /// Given an item in the picker, return the file path and line number to display. - file_fn: Option Option>>, + file_fn: Option>, } impl Picker { @@ -144,7 +146,7 @@ impl Picker { options: Vec, editor_data: T::Data, callback_fn: Box, - preview_fn: Option Option + 'static>>, + preview_fn: Option>, ) -> Self { let prompt = Prompt::new( "".into(), @@ -281,7 +283,6 @@ impl Picker { let pattern = self.prompt.line(); self.previous_pattern.0.clone_from(pattern); self.previous_pattern.1 = query; - } pub fn force_score(&mut self) {