@@ -684,17 +684,19 @@ impl<T: Item + 'static> FilePicker<T> {
684 EventResult::Consumed(None)
684 EventResult::Consumed(None)
687− fn cursor(&self, area: Rect, ctx: &Editor) -> (Option<Position>, CursorKind) {
687+ fn cursor(&self, area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) {
688+ let block = Block::default().borders(Borders::ALL);
689+ // calculate the inner area inside the box
690+ let inner = block.inner(area);
693+ let area = inner.clip_left(1).with_height(1);
688− self.picker.cursor(area, ctx)
695+ self.prompt.cursor(area, editor)
691 fn required_size(&mut self, (width, height): (u16, u16)) -> Option<(u16, u16)> {
698 fn required_size(&mut self, (width, height): (u16, u16)) -> Option<(u16, u16)> {
692− let picker_width = if width > MIN_AREA_WIDTH_FOR_PREVIEW {
699+ self.completion_height = height.saturating_sub(4);
697− self.picker.required_size((picker_width, height))?;
698 Some((width, height))
700 Some((width, height))
@@ -826,8 +828,7 @@ impl<T: Item> Picker<T> {
827impl<T: Item + 'static> Component for Picker<T> {
829impl<T: Item + 'static> Component for Picker<T> {
828 fn required_size(&mut self, viewport: (u16, u16)) -> Option<(u16, u16)> {
830 fn required_size(&mut self, viewport: (u16, u16)) -> Option<(u16, u16)> {
829− self.completion_height = viewport.1.saturating_sub(4);
831+ unimplemented!()
833 fn handle_event(&mut self, event: &Event, cx: &mut Context) -> EventResult {
834 fn handle_event(&mut self, event: &Event, cx: &mut Context) -> EventResult {
@@ -1001,14 +1002,7 @@ impl<T: Item + 'static> Component for Picker<T> {
1003 fn cursor(&self, area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) {
1004 fn cursor(&self, area: Rect, editor: &Editor) -> (Option<Position>, CursorKind) {
1004− let block = Block::default().borders(Borders::ALL);
1005+ unimplemented!()
1005− // calculate the inner area inside the box
1006− let inner = block.inner(area);
1009− let area = inner.clip_left(1).with_height(1);
1011− self.prompt.cursor(area, editor)