on master help sign in
Move FilePicker::render from Component impl to normal impl
40916dfGokul Soumya
helix-term/src/ui/picker.rs+7−3
@@ -269,10 +269,8 @@ impl<T: Item + 'static> FilePicker<T> {
269
269
270 EventResult::Consumed(callback)
270 EventResult::Consumed(callback)
271 }
271 }
272−}
273
272
274−impl<T: Item + 'static> Component for FilePicker<T> {
275− fn render(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) {
273+ fn render_picker(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) {
276 // +---------+ +---------+
274 // +---------+ +---------+
277 // |prompt | |preview |
275 // |prompt | |preview |
278 // +---------+ | |
276 // +---------+ | |
@@ -416,6 +414,12 @@ impl<T: Item + 'static> Component for FilePicker<T> {
416 }
414 }
417}
415}
418
416
417+impl<T: Item + 'static> Component for FilePicker<T> {
418+ fn render(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) {
419+ self.render_picker(area, surface, cx);
420+ }
421+}
422+
419#[derive(PartialEq, Eq, Debug)]
423#[derive(PartialEq, Eq, Debug)]
420struct PickerMatch {
424struct PickerMatch {
421 score: i64,
425 score: i64,