Skip to content

Commit 804fbd2

Browse files
committed
Show number of selected bytes in status bar
1 parent 7c837d5 commit 804fbd2

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/global/status_bar.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,15 @@ pub fn status_bar_draw(app: &mut App, frame: &mut Frame, area: Rect) {
5656
.alignment(Alignment::Left);
5757
frame.render_widget(status_bar_info_left, area);
5858

59+
let selected = if app.state == UIState::HexSelection {
60+
format!("{:X}", app.hex_view.selection.end.saturating_sub(app.hex_view.selection.start))
61+
} else {
62+
"".to_string()
63+
};
64+
5965
let status_bar_info_right = Paragraph::new(format!(
60-
"{} {} {} {:08X} {}%",
61-
mode, bookmarks_string, app.file_info.r#type, app.hex_view.offset, percent
66+
"{} {} {} {} {:08X} {}%",
67+
mode, bookmarks_string, app.file_info.r#type, selected, app.hex_view.offset, percent
6268
))
6369
.style(app.config.theme.topbar)
6470
.alignment(Alignment::Right);

0 commit comments

Comments
 (0)