@@ -91,15 +91,25 @@ impl<T> FilePicker<T> {
9191 callback_fn: impl Fn(&mut Context, &T, Action) + 'static,
9292 preview_fn: impl Fn(&Editor, &T) -> Option<FileLocation> + 'static,
9393 ) -> Self {
94+ let truncate_start = true;
95+ let mut picker = Picker::new(options, format_fn, callback_fn);
96+ picker.truncate_start = truncate_start;
97+
9498 Self {
95− picker: Picker::new(options, format_fn, callback_fn),
96− truncate_start: true,
99+ picker,
100+ truncate_start,
97101 preview_cache: HashMap::new(),
98102 read_buffer: Vec::with_capacity(1024),
99103 file_fn: Box::new(preview_fn),
100104 }
101105 }
102106
107+ pub fn truncate_start(mut self, truncate_start: bool) -> Self {
108+ self.truncate_start = truncate_start;
109+ self.picker.truncate_start = truncate_start;
110+ self
111+ }
112+
103113 fn current_file(&self, editor: &Editor) -> Option<FileLocation> {
104114 self.picker
105115 .selection()
@@ -176,7 +186,6 @@ impl<T: 'static> Component for FilePicker<T> {
176186 };
177187
178188 let picker_area = area.with_width(picker_width);
179− self.picker.truncate_start = self.truncate_start;
180189 self.picker.render(picker_area, surface, cx);
181190
182191 if !render_preview {