nu-table: Fix a term_width value (#5997)

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
Maxim Zhiburt
2022-07-09 22:55:47 +03:00
committed by GitHub
parent e4c512e33d
commit 121e8678b6
2 changed files with 4 additions and 4 deletions

View File

@ -22,10 +22,10 @@ const INDEX_COLUMN_NAME: &str = "index";
fn get_width_param(width_param: Option<i64>) -> usize {
if let Some(col) = width_param {
col as usize
} else if let Some((Width(w), Height(_h))) = terminal_size::terminal_size() {
(w - 1) as usize
} else if let Some((Width(w), Height(_))) = terminal_size::terminal_size() {
w as usize
} else {
80usize
80
}
}