Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix padding when running input list on tables #9316

Merged
merged 4 commits into from May 31, 2023

Conversation

carterisonline
Copy link
Contributor

Description

Improves the output when running input list on tabular data by aligning each column.

User-Facing Changes

Before

before

After

after

Tests + Formatting

After Submitting

@fdncred
Copy link
Collaborator

fdncred commented May 29, 2023

nice! that looks better! thanks

Copy link
Member

@amtoine amtoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's very nice, thanks 🤩

i've tried with ansi --list, which is yet another table and get the following results:
9316 before
9316 after

do you have the same slightly misaligned columns?

@fdncred
Copy link
Collaborator

fdncred commented May 30, 2023

I suspect ansi escapes are the culprit on the ansi --list test
image

This

$"(ansi red)Nushell(ansi escape)" | str length
13

vs

"Nushell" | str length
7

@carterisonline
Copy link
Contributor Author

Just pushed a fix that uses nu_utils::strip_ansi_likely to calculate the displayed length properly when using ANSI codes.
image

@fdncred
Copy link
Collaborator

fdncred commented May 30, 2023

clippy is such a drama queen sometimes 🤣

Copy link
Member

@amtoine amtoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing 🤩

thanks @fdncred for the hint and thanks @carterisonline for fixing this super quick 😊

let's land this to have much better input listed tables ✨

@amtoine amtoine merged commit e6be167 into nushell:main May 31, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants