Skip to content

Commit

Permalink
Only render preview if picker has a preview function (helix-editor#8667)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmehri01 authored and dgkf committed Jan 30, 2024
1 parent 19330e2 commit 2288a88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion helix-term/src/ui/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,8 @@ impl<T: Item + 'static + Send + Sync> Component for Picker<T> {
// | | | |
// +---------+ +---------+

let render_preview = self.show_preview && area.width > MIN_AREA_WIDTH_FOR_PREVIEW;
let render_preview =
self.show_preview && self.file_fn.is_some() && area.width > MIN_AREA_WIDTH_FOR_PREVIEW;

let picker_width = if render_preview {
area.width / 2
Expand Down

0 comments on commit 2288a88

Please sign in to comment.