From fc111213b5b5a3130399cda8a1964fa89acf153a Mon Sep 17 00:00:00 2001 From: Gokul Soumya Date: Sun, 18 Jun 2023 12:14:41 -0500 Subject: [PATCH] Move FilePicker struct def closer to impl block --- helix-term/src/ui/picker.rs | 60 ++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 902c16a0e..c06918d4d 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -77,36 +77,6 @@ type FileCallback = Box Option>; /// File path and range of lines (used to align and highlight lines) pub type FileLocation = (PathOrId, Option<(usize, usize)>); -pub struct FilePicker { - options: Vec, - editor_data: T::Data, - // filter: String, - matcher: Box, - matches: Vec, - - /// Current height of the completions box - completion_height: u16, - - cursor: usize, - // pattern: String, - prompt: Prompt, - previous_pattern: (String, FuzzyQuery), - /// Whether to show the preview panel (default true) - show_preview: bool, - /// Constraints for tabular formatting - widths: Vec, - - callback_fn: PickerCallback, - - picker: Picker, - pub truncate_start: bool, - /// Caches paths to documents - preview_cache: HashMap, - read_buffer: Vec, - /// Given an item in the picker, return the file path and line number to display. - file_fn: FileCallback, -} - pub enum CachedPreview { Document(Box), Binary, @@ -144,6 +114,36 @@ impl Preview<'_, '_> { } } +pub struct FilePicker { + options: Vec, + editor_data: T::Data, + // filter: String, + matcher: Box, + matches: Vec, + + /// Current height of the completions box + completion_height: u16, + + cursor: usize, + // pattern: String, + prompt: Prompt, + previous_pattern: (String, FuzzyQuery), + /// Whether to show the preview panel (default true) + show_preview: bool, + /// Constraints for tabular formatting + widths: Vec, + + callback_fn: PickerCallback, + + picker: Picker, + pub truncate_start: bool, + /// Caches paths to documents + preview_cache: HashMap, + read_buffer: Vec, + /// Given an item in the picker, return the file path and line number to display. + file_fn: FileCallback, +} + impl FilePicker { pub fn new( options: Vec,