summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2024-03-10 08:16:45 +0100
committerSebastian Thiel <sebastian.thiel@icloud.com>2024-03-10 08:16:45 +0100
commit24a6c29b3f48289cb6374aa66e84357edb5d0d54 (patch)
tree27ead6a81510e7f24d7677324f82349e7c345e12
parent8ab4ee72423bba54402525b4ea4593f0c582261e (diff)
fix: mark-pane help bar now shows closest to the selected item.
Previously this would only work in the first screen, but not when the list was long enough for scrolling.
-rw-r--r--src/interactive/widgets/mark.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interactive/widgets/mark.rs b/src/interactive/widgets/mark.rs
index 8959017..67f465e 100644
--- a/src/interactive/widgets/mark.rs
+++ b/src/interactive/widgets/mark.rs
@@ -359,8 +359,8 @@ impl MarkPane {
let list_area = if self.has_focus {
let (help_line_area, list_area) = {
- let help_at_bottom =
- selected.unwrap_or(0) >= inner_area.height.saturating_sub(1) as usize / 2;
+ let help_at_bottom = selected.unwrap_or(0).saturating_sub(self.list.offset)
+ >= inner_area.height.saturating_sub(1) as usize / 2;
let constraints = {
let mut c = vec![Constraint::Length(1), Constraint::Max(256)];
if help_at_bottom {