mirror of
https://github.com/nushell/nushell
synced 2024-11-10 15:14:14 +00:00
nu-table: Fix a term_width value (#5997)
Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
This commit is contained in:
parent
e4c512e33d
commit
121e8678b6
2 changed files with 4 additions and 4 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -79,7 +79,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ansi_rs"
|
name = "ansi_rs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://gitlab.com/zhiburt/ansi_rs#f45b8378e5ac7bafc0ca2d2748505fe92e2af6d6"
|
source = "git+https://gitlab.com/zhiburt/ansi_rs#16173ad4a2812a2b0dc9faf1552d5985db4ee310"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nom 7.1.1",
|
"nom 7.1.1",
|
||||||
]
|
]
|
||||||
|
|
|
@ -22,10 +22,10 @@ const INDEX_COLUMN_NAME: &str = "index";
|
||||||
fn get_width_param(width_param: Option<i64>) -> usize {
|
fn get_width_param(width_param: Option<i64>) -> usize {
|
||||||
if let Some(col) = width_param {
|
if let Some(col) = width_param {
|
||||||
col as usize
|
col as usize
|
||||||
} else if let Some((Width(w), Height(_h))) = terminal_size::terminal_size() {
|
} else if let Some((Width(w), Height(_))) = terminal_size::terminal_size() {
|
||||||
(w - 1) as usize
|
w as usize
|
||||||
} else {
|
} else {
|
||||||
80usize
|
80
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue