aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Mehri2023-10-30 20:03:38 +0000
committerGitHub2023-10-30 20:03:38 +0000
commitd0430f1c8166e5aad495474eb5c847a0df4dcb2f (patch)
tree84441ab671e5074ab9d1a110a5e9951da953f8e6
parent7d7ed78681797d2dffa1070060e063a508a18ecf (diff)
Only render preview if picker has a preview function (#8667)
-rw-r--r--helix-term/src/ui/picker.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs
index 2c41fc12..0214a391 100644
--- a/helix-term/src/ui/picker.rs
+++ b/helix-term/src/ui/picker.rs
@@ -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