mirror of
https://github.com/nushell/nushell.git
synced 2024-12-27 01:19:25 +01:00
Fix the utf-8 width calculation
This commit is contained in:
parent
1dc1b0d071
commit
1cdfe358c2
@ -78,13 +78,16 @@ impl TableView {
|
|||||||
for head in 0..headers.len() {
|
for head in 0..headers.len() {
|
||||||
let mut current_col_max = 0;
|
let mut current_col_max = 0;
|
||||||
for row in 0..values.len() {
|
for row in 0..values.len() {
|
||||||
let value_length = entries[row][head].0.len();
|
let value_length = entries[row][head].0.chars().count();
|
||||||
if head > entries[row].len() && value_length > current_col_max {
|
if value_length > current_col_max {
|
||||||
current_col_max = value_length;
|
current_col_max = value_length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
max_per_column.push(std::cmp::max(current_col_max, headers[head].len()));
|
max_per_column.push(std::cmp::max(
|
||||||
|
current_col_max,
|
||||||
|
headers[head].chars().count(),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Different platforms want different amounts of buffer, not sure why
|
// Different platforms want different amounts of buffer, not sure why
|
||||||
|
Loading…
Reference in New Issue
Block a user