mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:34 +00:00
Adjust panel calculation to account for base and group
This commit is contained in:
1 parent
a8cffbb6df
commit
2861cd51ac
1 file changed
+7
-2
+7
-2
@@ -321,9 +321,14 @@ fn run() -> Result<(), AnyhowError> {
|
||||
.transpose()?
|
||||
.unwrap_or(0);
|
||||
|
||||
let max_panels_fn = |terminal_width: u64| {
|
||||
let max_panels_fn = |terminal_width: u64, base_digits: u64, group_bytes: u64| {
|
||||
let offset = if show_position_panel { 10 } else { 1 };
|
||||
let col_width = if show_char_panel { 35 } else { 26 };
|
||||
let col_width = if show_char_panel {
|
||||
((8 / group_bytes) * (base_digits * group_bytes + 1)) + 2 + 8
|
||||
} else {
|
||||
((8 / group_bytes) * (base_digits * group_bytes + 1)) + 2
|
||||
};
|
||||
dbg!(terminal_width, col_width);
|
||||
if (terminal_width - offset) / col_width < 1 {
|
||||
1
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user