From d9a0c5032cc5b5a2b0c4764b1ffd4a10e19238f7 Mon Sep 17 00:00:00 2001 From: Ryan Mehri Date: Mon, 30 Oct 2023 12:06:19 -0700 Subject: [PATCH] only render preview if picker has a preview function --- helix-term/src/ui/picker.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 2c41fc12d685..0214a391023f 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -795,7 +795,8 @@ impl Component for Picker { // | | | | // +---------+ +---------+ - 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