From 9abf1f2446c1ab70600c53b557babdcbccdf8ce8 Mon Sep 17 00:00:00 2001 From: amtoine Date: Fri, 19 Apr 2024 16:10:52 +0200 Subject: [PATCH] don't highlight with compact layout and at bottom --- src/ui.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ui.rs b/src/ui.rs index d4414cd..942f9b1 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -460,11 +460,17 @@ fn render_data(frame: &mut Frame, app: &mut App) { .highlight_style(highlight_style) .highlight_symbol(&config.colors.selected_symbol); + let selected = if app.is_at_bottom() { + None + } else { + Some(selected) + }; + frame.render_stateful_widget( items, rect_without_bottom_bar, &mut ListState::default() - .with_selected(Some(selected)) + .with_selected(selected) .with_offset(margin_offset), ) }