summaryrefslogtreecommitdiffstats
path: root/src/interactive/widgets/mark.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/interactive/widgets/mark.rs')
-rw-r--r--src/interactive/widgets/mark.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/interactive/widgets/mark.rs b/src/interactive/widgets/mark.rs
index 96b9862..53833ae 100644
--- a/src/interactive/widgets/mark.rs
+++ b/src/interactive/widgets/mark.rs
@@ -20,6 +20,7 @@ use tui::{
};
use tui_react::{
draw_text_nowrap_fn,
+ util::rect::line_bound,
util::{block_width, rect},
List, ListProps,
};
@@ -373,7 +374,7 @@ impl MarkPane {
self.list.render(props, entries, list_area, buf);
if has_focus {
- let help_text = " . = o|.. = u || ⇊ = CTRL+d|↓ = j|⇈ = CTRL+u|↑ = k ";
+ let help_text = " . = o|.. = u ── ⇊ = CTRL+d|↓ = j|⇈ = CTRL+u|↑ = k ";
let help_text_block_width = block_width(help_text);
let bound = Rect {
width: area.width.saturating_sub(1),
@@ -387,6 +388,17 @@ impl MarkPane {
|_, _, _| Style::default(),
);
}
+ let bound = line_bound(bound, bound.height.saturating_sub(1) as usize);
+ let help_text = " mark-toggle = space|d";
+ let help_text_block_width = block_width(help_text);
+ if help_text_block_width <= bound.width {
+ draw_text_nowrap_fn(
+ rect::snap_to_right(bound, help_text_block_width),
+ buf,
+ help_text,
+ |_, _, _| Style::default(),
+ );
+ }
}
}
}