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 Schuyler Mortimer committed Jul 10, 2024
1 parent 370f5f9 commit 03c7baf
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 @@ -811,7 +811,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 03c7baf

Please sign in to comment.